Sunday, 24.09.2017, 15:16
Приветствую Вас Гость
Register | Login | RSS
Jedi Academy Server Security
[ New messages · Users · Forum rules · Search · RSS ]
Page 1 of 11
Forum » JASS » English forum » Crash after using g_gents[arg0]
Crash after using g_gents[arg0]
cordDate: Sunday, 10.02.2013, 12:43 | Message # 1
Group: User
Messages: 4
Reputation: 0
Status: Offline
Hi,

i have a problem with g_gents[arg0]. I do the same like in the creating plugin topic.

Код
C_DLLEXPORT int JASS_syscall(int cmd, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10, int arg11, int arg12)  
{
     if (cmd == G_LOCATE_GAME_DATA)  
     {
             g_gents = (gentity_t*)arg0;
             g_gentsize = arg2;
             g_clients = (gclient_t*)arg3;
             g_clientsize = arg4;
     }  
     JASS_RET_IGNORED(1);
}


After this i make a command in the main.

Код
C_DLLEXPORT int JASS_vmMain(int cmd, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10, int arg11)  
{
      [....]
      if(!strcmp(command,"myname"))
      {
            g_syscall(G_SEND_SERVER_COMMAND,arg0,JASS_VARARGS("print \"Test: My  
name is %s\n\"",g_gents[arg0].client->pers.netname));
      }
      [....]
}

but it crash after using this commad. It works only on the first client on the server. If the next connected client use this command he will crash the server.
Im sure that i forget something, but what?
 
BufferOverflowDate: Friday, 15.02.2013, 14:59 | Message # 2
Group: Developer
Messages: 47
Reputation: 0
Status: Offline
I see no bugs here. Maybe, your problem is outside of this code piece? Btw, I'll add a "Debugging" section into my manual. For now I guess somehow g_gents get changed or there is some code out of this peace that uses some resources and deletes it.
 
WEAPON_XDate: Wednesday, 27.02.2013, 08:43 | Message # 3
Group: User
Messages: 12
Reputation: 0
Status: Offline
if you are using jass with another mod try using CLIENT_FROM_NUM or ENT_FROM_NUM to get the entity or client.
the reason is that the structures might be different from base.


Message edited by WEAPON_X - Wednesday, 27.02.2013, 08:46
 
cordDate: Thursday, 28.02.2013, 23:26 | Message # 4
Group: User
Messages: 4
Reputation: 0
Status: Offline
Hi,

Sorry for the late reply.

Quote
I see no bugs here. Maybe, your problem is outside of this code piece? Btw,
I'll add a "Debugging" section into my manual. For now I guess somehow
g_gents get changed or there is some code out of this peace that uses
some resources and deletes it.

something like that, yes. I tried the same example command in base, and i had no problems.

Quote
if you are using jass with another mod try using CLIENT_FROM_NUM or ENT_FROM_NUM to get the entity or client.
the reason is that the structures might be different from base.


Same, problem. It wont work really ^^'. But in basejka it works perfectly.

But thanks for the help :).
 
Forum » JASS » English forum » Crash after using g_gents[arg0]
Page 1 of 11
Search: