-=-
Menu
Tournaments
Profile
Poll
Latest videos
Latest comments
Latest matches
flag CX [20:00] [CDF]flag
flag [GpW] [07:04] [CDF]flag
flag [GpW] [10:07] [CDF]flag
flag [CDF] [03:07] [GpW]flag
flag [GpW] [08:04] [CDF]flag
flag [CDF] [04:09] [GpW]flag
flag [CDF] [03:06] [GpW]flag
flag [CDF] [04:06] [GpW]flag
flag -t3> [08:02] Cxnflag
flag [CDF] [10:02] Cxnflag
Latest forum posts
By: [GpW]Urbs, in: incorrect dates for clanwars » JJ2 related 2020-01-02 21:56
kimo back yo :kali:
By: KiMO, in: incorrect dates for clanwars » JJ2 related 2020-01-02 16:10
i am the present
By: Loon, in: incorrect dates for clanwars » JJ2 related 2019-12-31 10:05
hi kimo was that the present?
By: KiMO, in: incorrect dates for clanwars » JJ2 related 2019-12-31 03:09
wow
By: ThunDer, in: incorrect dates for clanwars » JJ2 related 2019-12-25 14:03
which presento m8 i-)
By: King, in: incorrect dates for clanwars » JJ2 related 2019-12-25 00:14
I like your xmas presento kristo!
By: Krzysiek, in: incorrect dates for clanwars » JJ2 related 2019-12-25 00:10
merry xmas
By: ThunDer, in: incorrect dates for clanwars » JJ2 related 2019-12-24 11:55
MS our man :*
By: MasterSven, in: incorrect dates for clanwars » JJ2 related 2019-12-24 08:33
You guys are basically making a fool out of yourse...
By: Naps, in: incorrect dates for clanwars » JJ2 related 2019-12-23 18:11
I partially understand your point but the people w...
By: Artegor, in: incorrect dates for clanwars » JJ2 related 2019-12-23 17:38
Of course it does not protect you, you kinda missi...
By: Naps, in: incorrect dates for clanwars » JJ2 related 2019-12-23 17:28
VPN does not protect you from DDOS attacks at all,...
By: Artegor, in: incorrect dates for clanwars » JJ2 related 2019-12-23 17:15
Naps, there's something called VPN. You can find f...
By: Pariah, in: incorrect dates for clanwars » JJ2 related 2019-12-22 07:01
you are right, i have nothing to contirbute. war, ...
By: Naps, in: incorrect dates for clanwars » JJ2 related 2019-12-22 04:00
It would have been better if you rather contribute...
By: i:m, in: incorrect dates for clanwars » JJ2 related 2019-12-20 01:33
ok but why did jety leave gpw :???:
By: Pariah, in: incorrect dates for clanwars » JJ2 related 2019-12-19 23:45
recently people have put the incorrect dates for c...
By: Pariah, in: A new balance proposal » Improving rules 2019-12-19 22:42
@rag: spaz meelee move is not so special jazz and ...
By: Abdoun, in: Funniest moments! » Forum games 2019-12-18 00:55
1-/: i dont forfeit i just dont wanna play :S
By: Ragnarok, in: A new balance proposal » Improving rules 2019-11-20 19:49
Just thought I'd share my two pieces on what copte...
By: Ragnarok, in: Contest results! [JJnet Level Contest Season 13] » JJ2 related 2019-11-02 04:17
In alphabetical order: 1. Byzantine Blues by...
By: Vivando, in: Contest results! [JJnet Level Contest Season 13] » JJ2 related 2019-11-01 20:11
Feedback! from SJ: FTL Starship: + Fairly ba...
By: Vivando, in: Contest results! [JJnet Level Contest Season 13] » JJ2 related 2019-11-01 20:09
Dear all, the level contest results are finally he...
By: Treylina, in: A new balance proposal » Improving rules 2019-10-22 01:00
Here it is, a long overdue update. Better late tha...
By: Toni, in: What JJ2 level title best describes your sex life? » JJ2 related 2019-09-08 01:11
Underrated Paradise
By: DanZeal, in: Funniest moments! » Forum games 2019-09-07 20:02
[20:00:05] DannyZ[CDF]: Jag var i Finland tidigare...
By: SirEmentaler, in: What JJ2 level title best describes your sex life? » JJ2 related 2019-08-21 20:45
I just wanted to say this topic was inspired by a ...
By: Slaz, in: What JJ2 level title best describes your sex life? » JJ2 related 2019-08-20 14:13
ELEKTREK PYRAMID :dizzy:
By: PurpleJazz, in: What JJ2 level title best describes your sex life? » JJ2 related 2019-08-19 06:44
15 Second Rush
By: Laro24, in: What JJ2 level title best describes your sex life? » JJ2 related 2019-08-10 19:15
Nuclear Afterblast :whistling:
By: Plumbe, in: What JJ2 level title best describes your sex life? » JJ2 related 2019-08-10 16:50
Wicked Wood :flex:
By: [GpW]Urbs, in: What JJ2 level title best describes your sex life? » JJ2 related 2019-08-10 15:59
Jungles Edge :D
By: ThunDer, in: What JJ2 level title best describes your sex life? » JJ2 related 2019-08-10 02:46
Facing Worlds
By: Ragnarok, in: What JJ2 level title best describes your sex life? » JJ2 related 2019-08-09 18:30
Drought :whisper:
By: MasterSven, in: What JJ2 level title best describes your sex life? » JJ2 related 2019-08-09 15:33
There can be only one: Magma P*nis Despair. :carr...
More...!

JJnet's forum

«Latest posts» «Latest threads» «Search» «User CP»

     Need help with some angelscript coding! | [q] 2015-06-09 17:59
Gigoavatar
JJnet user

Posts: 2
0
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]emo;
                }
        }
        if(dataType == -1)
        {
                for(int i = 0; i < dlugoscPliku; i++)
                {
                        plikDane.push(userPoints[i]emo;
                }
        }
        if(dataType == -2)
        {
                for(int i = 0; i < dlugoscPliku; i++)
                {
                        plikDane.push(userProgress[i]emo;
                }
        }
}


(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
Replies
KRSplatinum
avatar

JJnet user
Posts: 259
14
#1 | [q]2015-06-09 23:24
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
Gigo
avatar

JJnet user
Posts: 2
0
#2 | [q]2015-06-10 21:59
Well nevermind. I got it to work. The problem was caused by the packets being too big. Thanks to SE for help emo Thread can be closed now.