-=-
Menu
Tournaments
Profile
Poll
Latest videos
Latest comments
Latest matches
flag CX [13:15] [GpW]flag
flag [CDF] [08:14] -t3>flag
flag [GpW] [11:05] -t3>flag
flag -t3> [08:02] CXflag
flag -t3> [12:09] CXflag
flag -t3> [11:07] CXflag
flag [GpW] [12:06] [CDF]flag
flag [GpW] [12:05] [CDF]flag
flag [GpW] [07:06] -t3>flag
flag CX [07:06] [GpW]flag
Latest forum posts
By: ShakerNL, in: Ladre Offseazon » Forum games 2020-07-05 00:48
Wanna play some Mario? https://www.pukenukem.co...
By: Splat, in: Ladre Offseazon » Forum games 2020-06-24 04:51
Haven't[*] played that game before myself. Reminds...
By: i:m, in: Ladre Offseazon » Forum games 2020-06-21 17:56
i recently played this game called 'i am bread' an...
By: i:m, in: Drama over the Ladder (JJ2 fanfic) » Forum games 2020-06-21 17:50
fucking diamondus :D
By: Splat, in: Drama over the Ladder (JJ2 fanfic) » Forum games 2020-06-20 03:28
[quote]Foreword: Thanks to JJnet admins for approv...
By: Splat, in: JJ1 sound effect samples » JJ2 related 2020-06-16 03:09
Hi, I want to post about my samplepack of JJ1 soun...
By: Splat, in: Ladre Offseazon » Forum games 2020-06-12 07:04
Durinğ the ladre offseason, there are some nice g...
By: MaximuS , in: Wimbledon Duel Rankings » Published Steel Duels cases 2020-06-06 23:34
:whip: epic
By: Pariah, in: Wimbledon Duel Rankings » Published Steel Duels cases 2020-06-04 20:50
oh,,, wow, splat ranked #4 ohhh
By: Splat, in: Wimbledon Duel Rankings » Published Steel Duels cases 2020-06-04 05:37
I am here to announce the duel rankings in wimbled...
By: Splat, in: [NT 2020] Sign Ups » National Tournament 2020-06-04 00:37
Retrōğrâde respønse: it's naturally plausïble...
By: King, in: Funniest moments! » Forum games 2020-05-19 20:40
:(
By: i:m, in: Funniest moments! » Forum games 2020-05-19 20:37
[23:46:21] Jety: pavlo, u wanted wrn's ip? [23:46...
By: i:m, in: Funniest moments! » Forum games 2020-05-19 20:33
[23:07:40] o0o: join cw server when [23:07:41] [S...
By: Toni, in: [NT 2020] News » National Tournament 2020-05-16 16:23
First week of knockout stage is completed! We h...
By: Toni, in: [NT 2020] News » National Tournament 2020-05-12 00:49
Knockout stage games First semifinal game has b...
By: Toni, in: [NT 2020] News » National Tournament 2020-04-18 21:38
First week of knockout stage is completed! We h...
By: Lahm, in: [NT 2020] National Tournament Starts! » National Tournament 2020-03-29 23:31
RO vetoes: AM and DW
By: Vivando, in: [NT 2020] National Tournament Starts! » National Tournament 2020-03-29 19:42
Added vetoes for team Nordics earlier. I'll announ...
By: Lynx[GpW], in: [NT 2020] National Tournament Starts! » National Tournament 2020-03-28 22:16
Czechoslovakia vetoes: TCS and DW
By: Krzysiek, in: [NT 2020] National Tournament Starts! » National Tournament 2020-03-28 21:19
Poland: DW and AM
By: Toni, in: [NT 2020] National Tournament Starts! » National Tournament 2020-03-28 17:50
Serbia B: Epitome and Stronghold
By: Kyro, in: [NT 2020] National Tournament Starts! » National Tournament 2020-03-28 17:45
Egypt vetoes: Diamondus Warzone & Technodus Cargo ...
By: Kev, in: [NT 2020] National Tournament Starts! » National Tournament 2020-03-28 13:42
Germany vetos: Astro and Daybreak
By: Ragnarok, in: [NT 2020] National Tournament Starts! » National Tournament 2020-03-27 21:46
That's good Urbs! What's the best way to conta...
By: [GpW]Urbs, in: [NT 2020] National Tournament Starts! » National Tournament 2020-03-27 21:33
BTW not sure where to post this, but I guess i cou...
By: MasterSven, in: [NT 2020] National Tournament Starts! » National Tournament 2020-03-27 17:17
Netherlands vetoes: Distopia and Astro.
By: MaximuS , in: [NT 2020] National Tournament Starts! » National Tournament 2020-03-27 14:41
Team Brexit vetoes: none
By: HordY, in: [NT 2020] National Tournament Starts! » National Tournament 2020-03-27 14:01
Serbia A vetoes: DW and TCS.
By: Toni, in: [NT 2020] National Tournament Starts! » National Tournament 2020-03-27 12:55
You can announce your veto maps here before you sc...
By: Laro24, in: [NT 2020] National Tournament Starts! » National Tournament 2020-03-27 01:37
Brexit..? xd rly?
By: MaximuS , in: [NT 2020] National Tournament Starts! » National Tournament 2020-03-26 20:11
Final egy srb
By: Vivando, in: [NT 2020] National Tournament Starts! » National Tournament 2020-03-26 17:12
Group A pog 3:-)
By: Toni, in: [NT 2020] National Tournament Starts! » National Tournament 2020-03-26 15:58
Dear players, Hereby we announce the grand open...
By: Kev, in: [NT 2020] Sign Ups » National Tournament 2020-03-24 15:37
pull some american continent team of splat, empive...
By: HordY, in: [NT 2020] Sign Ups » National Tournament 2020-03-24 10:57
Just a suggestion * As for now we have 11 teams...
By: Ragnarok, in: [NT 2020] Sign Ups » National Tournament 2020-03-23 20:10
For those who are interested in the mappool: - ...
By: Kyro, in: [NT 2020] Sign Ups » National Tournament 2020-03-23 17:12
EGYPT Kyro (cpt.) Anna A7med Batata Sonic ...
By: MasterSven, in: [NT 2020] Sign Ups » National Tournament 2020-03-23 10:21
There is nothing wrong with listing them. Its mor...
By: Kev, in: [NT 2020] Sign Ups » National Tournament 2020-03-23 08:52
whats wrong with listing inactive players? perhaps...
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.