| Blockland Forums > Modification Help |
| Making the client respond to the server(TOPIC NAME CHANGED) |
| << < (7/10) > >> |
| Reinforcements:
This is being called --- Code: ---function clientCmdAddOnCheck() { commandToServer('AddonLoaded'); echo("responded"); } --- End code --- But THIS one isn't. :O --- Code: ---function serverCmdAddonLoaded(%client) { echo("DENIED KICK, YEAH!"); cancel(%client.addOnTimeout); %client.hasTheAddonCheck = true; } --- End code --- heres the server.cs --- Code: ---package requiredAddOn { function gameConnection::onClientEnterGame(%this) { //%this.isHost = (%this.isLocalConnection() || %this.bl_id == getNumKeyID()); //if(%this.isHost == true) //{ // return parent::onClientEnterGame(%this); //} commandToClient(%this, 'AddonCheck'); %this.addOnTimeout = %this.schedule((%this.getPing() * 2) + 100, delete, "You must have <a:apple.com>this add-on</a> to play on this server."); return parent::onClientEnterGame(%this); echo("the client entered the game, bro"); } }; activatePackage(requiredAddOn); function serverCmdAddonLoaded(%client) { echo("DENIED KICK, YEAH!"); cancel(%client.addOnTimeout); %client.hasTheAddonCheck = true; } --- End code --- Client.cs: --- Code: ---function clientCmdAddOnCheck() { commandToServer('AddonLoaded'); echo("responded"); } --- End code --- |
| Red_Guy:
ok - try this version: --- Code: --- function gameConnection::onClientEnterGame(%this) { echo("the client entered the game, bro"); commandToClient(%this, 'AddonCheck'); // no schedule for now // schedule( ............. return parent::onClientEnterGame(%this); } --- End code --- run and see what happens. does the response from the client EVER show up? you can also have your friend type: commandToServer('AddonLoaded'); directly into his console. then watch what you get back also do the same on your donsole. both should get your message back. if that fails to respond, then chances are you have an addon thats interfearing with your own mod, so disable EVERYTHING else and retry. |
| Space Guy:
I can remove all other code in your add-on apart from whatever kind of "update" function you have. There really is no way to enforce this and sending schedules every second won't improve it at all. |
| Reinforcements:
--- Quote from: Space Guy on February 15, 2011, 04:47:08 PM ---I can remove all other code in your add-on apart from whatever kind of "update" function you have. There really is no way to enforce this and sending schedules every second won't improve it at all. --- End quote --- Not really sure what you mean by that. |
| Reinforcements:
--- Quote from: Red_Guy on February 15, 2011, 04:42:57 PM ---ok - try this version: --- Code: --- function gameConnection::onClientEnterGame(%this) { echo("the client entered the game, bro"); commandToClient(%this, 'AddonCheck'); // no schedule for now // schedule( ............. return parent::onClientEnterGame(%this); } --- End code --- run and see what happens. does the response from the client EVER show up? you can also have your friend type: commandToServer('AddonLoaded'); directly into his console. then watch what you get back also do the same on your donsole. both should get your message back. if that fails to respond, then chances are you have an addon thats interfearing with your own mod, so disable EVERYTHING else and retry. --- End quote --- Look at the pic, thats my console after I started the server. It responded by itself. :/ Oh, and I only have the minimal add-ons enabled(sometimes I have the duplicator enabled). Why does it have a problem with a schedule being around? Maybe it's shy ;) |
| Navigation |
| Message Index |
| Next page |
| Previous page |