-=-
Menu
Tournaments
Profile
Poll
Latest videos
Latest comments
Latest matches
flag CX [09:04] [GpW]flag
flag CX [04:08] [GpW]flag
flag CX [14:07] [GpW]flag
flag -t3> [06:04] [GpW]flag
flag CX [14:02] [CDF]flag
flag CX [07:07] [CDF]flag
flag CX [10:05] [CDF]flag
flag [GpW] [10:09] CXflag
flag CC [06:03] CXflag
flag [GpW] [11:02] [CDF]flag
Latest forum posts
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...
By: Jelly Jam, in: What JJ2 level title best describes your sex life? » JJ2 related 2019-08-09 11:49
This level is Untitled
By: SirEmentaler, in: What JJ2 level title best describes your sex life? » JJ2 related 2019-08-09 07:50
I'd probably have to go with Enter the Chaos but I...
By: Toni, in: Funniest moments! » Forum games 2019-08-08 16:21
Meanwhile in Gauntlet: [16:17:02] Console: >> [...
By: ThunDer, in: Carrots and Ladders » JJ2 related 2019-08-04 15:44
Imo ditch carrots and use apples instead for bette...
By: cooba, in: Carrots and Ladders » JJ2 related 2019-08-03 17:17
Tangential to the topic, but I've always thought t...
By: Ragnarok, in: Carrots and Ladders » JJ2 related 2019-08-03 15:12
Ok SE, here's what I suggest -- You make that l...
By: SirEmentaler, in: Carrots and Ladders » JJ2 related 2019-08-03 04:00
6 regular carrots with 90-second spawn times.
By: Ragnarok, in: All matches page stalls while loading » Site suggestions 2019-08-01 23:06
i'm in full support of this idea
By: Mercuryquake, in: Carrots and Ladders » JJ2 related 2019-08-01 20:45
It depends on several other aspects of the level. ...
By: Mercuryquake, in: All matches page stalls while loading » Site suggestions 2019-08-01 19:37
Trying to load the page for All Matches just stall...
By: Mercuryquake, in: Question for Jelly Jam » Ask Tira 2019-08-01 19:24
Coffee is a drug, actually. Therefore it shouldn't...
By: Jelly Jam, in: Carrots and Ladders » JJ2 related 2019-07-28 05:10
I voted for two full energy carrots, and although ...
By: Antix, in: Carrots and Ladders » JJ2 related 2019-07-28 03:29
Best CTF Party Goodluck proves everything, what a ...
By: Ragnarok, in: Carrots and Ladders » JJ2 related 2019-07-28 02:50
What's your favourite carrot scheme for CTF levels...
By: Jelly Jam, in: Question for Jelly Jam » Ask Tira 2019-07-22 01:56
utter sounds like udder
By: ThunDer, in: Question for Jelly Jam » Ask Tira 2019-07-20 02:31
I am utterly in agreement with all facts above.
By: Ragnarok, in: Question for Jelly Jam » Ask Tira 2019-07-18 19:22
I feel that there are several conclusions I have c...
By: SirEmentaler, in: Question for Jelly Jam » Ask Tira 2019-07-16 04:28
Like I said, these are "conclusions" rather than d...
By: Ragnarok, in: Question for Jelly Jam » Ask Tira 2019-07-15 09:18
from where did you cite such information?
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.