-=-
Menu
Tournaments
Profile
Poll
Latest videos
Latest comments
Latest matches
flag -t3> [11:02] CCflag
flag -t3> [08:00] CCflag
flag CX [09:11] [GpW]flag
flag CX [07:05] [GpW]flag
flag [GpW] [09:06] CXflag
flag CX [08:03] -t3>flag
flag CX [16:05] -t3>flag
flag [GpW] [07:03] -t3>flag
flag [GpW] [07:03] -t3>flag
flag [GpW] [13:10] -t3>flag
Latest forum posts
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...
By: MasterSven, in: [NT 2020] Sign Ups » National Tournament 2020-03-23 08:46
I agree Shaker. And its not just GER, but we will ...
By: ShakerNL, in: [NT 2020] Sign Ups » National Tournament 2020-03-23 00:04
Wait, is Kev serious? Most of those players have b...
By: Krzysiek, in: [NT 2020] Sign Ups » National Tournament 2020-03-22 20:47
Poland - Pati (Captain) - Dragon - Krzysiek ...
By: Toni, in: [NT 2020] Sign Ups » National Tournament 2020-03-22 16:36
8 teams already! :) 2 more days to sign up
By: Treylina, in: A new balance proposal » Improving rules 2020-03-22 02:40
After my long-arse hiatus from online play, I'm go...
By: Krzysiek, in: [NT 2020] Sign Ups » National Tournament 2020-03-21 18:41
lol 2k20 and sidzej still naming himself with 2 ni...
By: [GpW]Urbs, in: [NT 2020] Sign Ups » National Tournament 2020-03-21 18:14
Egypt not playing? FML no team Austro-Hungary :...
By: Vivando, in: [NT 2020] Sign Ups » National Tournament 2020-03-21 17:41
Team Nordics (NORD): -SJ/Vivando (Cpt.) -Black...
By: Lynx[GpW], in: [NT 2020] Sign Ups » National Tournament 2020-03-21 16:24
Czechoslovakia : -Lynx (cpt.) -Mirari -Clank...
By: Kev, in: [NT 2020] Sign Ups » National Tournament 2020-03-21 13:01
Germany Kev (cpt) JJB Shady H8breed Tiramis...
By: HordY, in: [NT 2020] Sign Ups » National Tournament 2020-03-21 12:39
Team SRB - A : ~ Hordy (cpt) - Artegor - Pavl...
By: MasterSven, in: [NT 2020] Sign Ups » National Tournament 2020-03-21 00:02
Team NL: MS (cpt.) Hyperion Loon FawFuL Lar...
By: Lahm, in: [NT 2020] Sign Ups » National Tournament 2020-03-20 19:12
Team RO : Lahm(cpt.) Naps Laser XxMoNsTeR N...
By: Ragnarok, in: [NT 2020] Sign Ups » National Tournament 2020-03-20 18:49
Team BREXIT: Bee (cpt.) o0o Purplejazz Ragna...
By: Ragnarok, in: [NT 2020] Sign Ups » National Tournament 2020-03-20 18:16
Clarification about fantasy teams: - If your co...
By: Lahm, in: [NT 2020] Sign Ups » National Tournament 2020-03-20 18:08
Inspired by the public demand and the quarantine-p...
By: [GpW]Urbs, in: incorrect dates for clanwars » JJ2 related 2020-01-02 21:56
kimo back yo :kali:
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.