So i just joined this forum. But you may recognize me from playing at puke nukem tests since last few months.
Anyway i've been trying to write some sort of test manager in angel script. The problem im stuck at is using the jjSendPacket() and onReceive().
Heres the part of the code that ruins my TM:
Code:
void wyslij()
{
jjSTREAM plikNicks("GigoNicks.asdat");
if(!plikNicks.isEmpty()) jjSendPacket(plikNicks);
}
void onReceive(jjSTREAM &in plikDane, int fromClientID)
{
int dataType;
plikDane.pop(dataType);
if(dataType >= 0)
{
dlugoscPliku = dataType;
for(int i = 0; i < dlugoscPliku; i++)
{
plikDane.push(userNicks[i];
}
}
if(dataType == -1)
{
for(int i = 0; i < dlugoscPliku; i++)
{
plikDane.push(userPoints[i];
}
}
if(dataType == -2)
{
for(int i = 0; i < dlugoscPliku; i++)
{
plikDane.push(userProgress[i];
}
}
}
(few things and variables are named in polish, sorry for that)
EDIT: lol part of the code got changed to emoticons ( those parts: " ) ;" without space)
You can probably ignore the whole content of "void onReceive()" as I even tried removing it and still got the same issue.
Its the jjSendPacket itself that causes problems: When another player joins my server, he gets instantly kicked with the "server denied you" error.
By instantly I mean he can stay in the server for up to 2 seconds - but thats becouse the function wyslij() is called every 2 seconds (every 140 frames). And btw. this function is only called by host (dunno if it has anything to do with my issue)
I've been stuck at this problem for some longer time and cant quite figure it out - angelscript debug says nothing about that. As soon as i remove jjSendPacket() those errors stop occuring - but thats not quite how I want my TM to work...
I hope there are some angelscript experts on this forum.
Thanx in advance
Hello!
So i just joined this forum. But you may recognize me from playing at puke nukem tests since last few months.
Anyway i've been trying to write some sort of test manager in angel script. The problem im stuck at is using the jjSendPacket() and onReceive().
Heres the part of the code that ruins my TM:
[code]
void wyslij()
{
jjSTREAM plikNicks("GigoNicks.asdat");
if(!plikNicks.isEmpty()) jjSendPacket(plikNicks);
}
void onReceive(jjSTREAM &in plikDane, int fromClientID)
{
int dataType;
plikDane.pop(dataType);
if(dataType >= 0)
{
dlugoscPliku = dataType;
for(int i = 0; i < dlugoscPliku; i++)
{
plikDane.push(userNicks[i]);
}
}
if(dataType == -1)
{
for(int i = 0; i < dlugoscPliku; i++)
{
plikDane.push(userPoints[i]);
}
}
if(dataType == -2)
{
for(int i = 0; i < dlugoscPliku; i++)
{
plikDane.push(userProgress[i]);
}
}
}
[/code]
(few things and variables are named in polish, sorry for that)
EDIT: lol part of the code got changed to emoticons ( those parts: " ) ;" without space)
You can probably ignore the whole content of "void onReceive()" as I even tried removing it and still got the same issue.
Its the jjSendPacket itself that causes problems: When another player joins my server, he gets instantly kicked with the "server denied you" error.
By instantly I mean he can stay in the server for up to 2 seconds - but thats becouse the function wyslij() is called every 2 seconds (every 140 frames). And btw. this function is only called by host (dunno if it has anything to do with my issue)
I've been stuck at this problem for some longer time and cant quite figure it out - angelscript debug says nothing about that. As soon as i remove jjSendPacket() those errors stop occuring - but thats not quite how I want my TM to work...
I hope there are some angelscript experts on this forum.
Thanx in advance
Why the semicolons just before the closing brackets? Is that needed? To me, a semicolon would indicate there will be another line of code before the closing brackets. I mean like instead of
Code:
{
xyz;
abc;
}
try:
Code:
{
xyz;
abc
}
Maybe that's just a mainstream tactic that doesn't apply in J2AS. Also it probably makes no difference
Why the semicolons just before the closing brackets? Is that needed? To me, a semicolon would indicate there will be another line of code before the closing brackets. I mean like instead of
[code]
{
xyz;
abc;
}
[/code]
try:
[code]
{
xyz;
abc
}
[/code]
Maybe that's just a mainstream tactic that doesn't apply in J2AS. Also it probably makes no difference