Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2015-05-12 19:13:45

benedani
Member
Joined: 2015-02-19
Posts: 98

Already joined players

How do I check the players that are already in the world? I want to add them to a list too.

Offline

#2 2015-05-12 19:15:01

ewoke
Member
Joined: 2015-02-20
Posts: 412

Re: Already joined players

if(m.Type == "add")
{
       list.Add(m.getString(1));
}

make sure you sent init2 in init;


if you can read this....good for you

Offline

#3 2015-05-12 19:15:19

capasha
Member
Joined: 2015-02-21
Posts: 4,066

Re: Already joined players

Send init2 when your message init executes. Then look for the add message.

Offline

#4 2015-05-12 19:21:13

benedani
Member
Joined: 2015-02-19
Posts: 98

Re: Already joined players

I mean the players that ALREADY are in the level when the bot joins.

Offline

#5 2015-05-12 19:22:24

CJMaeder
Member
From: Lame Land
Joined: 2015-04-06
Posts: 219

Re: Already joined players

If you wish to know if they joined before you, check see if their User ID is less than yours, if it's more then they joined after.


Lame!

Offline

#6 2015-05-12 19:24:31

benedani
Member
Joined: 2015-02-19
Posts: 98

Re: Already joined players

CJMAEDER wrote:

If you wish to know if they joined before you, check see if their User ID is less than yours, if it's more then they joined after.

I cannot get their ID in an "add" message then... it's in the worlddata, but I can't seem to be able to decompile it

Offline

#7 2015-05-12 19:29:39, last edited by CJMaeder (2015-05-12 19:30:20)

CJMaeder
Member
From: Lame Land
Joined: 2015-04-06
Posts: 219

Re: Already joined players

Their ID should be m.GetInt(0) in "add"


Lame!

Offline

#8 2015-05-12 19:32:29

benedani
Member
Joined: 2015-02-19
Posts: 98

Re: Already joined players

In "add" it gets the people who join when the bot IS in the level. I want to get players that the bot doesn't add because they joined before the bot. e.g. Somebody joins the world, I connect the bot

Offline

#9 2015-05-12 19:37:00

CJMaeder
Member
From: Lame Land
Joined: 2015-04-06
Posts: 219

Re: Already joined players

capasha wrote:

Send init2 when your message init executes. Then look for the add message.

did you read this?


Lame!

Offline

#10 2015-05-12 19:44:21

Thanel
Member
Joined: 2015-02-18
Posts: 713

Re: Already joined players

When you join with the bot and send the "init2" message Everybody Edits responds to you with "init" message and then "add" message for each player that is already in the world. This means that "add" is used for players that are already in the world and for these who join later.

As cjmaeder said if you check their id, then these players that have lower ID than yours (received from "init") joined before you and these with higher came later.

Offline

#11 2015-05-12 19:47:23, last edited by den3107 (2015-05-12 19:48:44)

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: Already joined players

When the "init" event is send to your bot, sent "init2" to the server.
Once you have send "init2", you will receive all events to keep you upto date with the server, under which all "add" events from all the players that have joined before you.

Edit:
Seems like Thanel beat me here...

Offline

#12 2015-05-12 19:51:29

benedani
Member
Joined: 2015-02-19
Posts: 98

Re: Already joined players

i sent init 2... I HAVE IT... now what?!

Offline

#13 2015-05-12 19:52:57

benedani
Member
Joined: 2015-02-19
Posts: 98

Re: Already joined players

oh wait i think i found it out

den3107 wrote:

When the "init" event is send to your bot, sent "init2" to the server.
Once you have send "init2", you will receive all events to keep you upto date with the server, under which all "add" events from all the players that have joined before you.

Edit:
Seems like Thanel beat me here...

Offline

#14 2015-05-12 19:56:35, last edited by benedani (2015-05-12 19:56:49)

benedani
Member
Joined: 2015-02-19
Posts: 98

Re: Already joined players

YES IT WROKED*!!! OMG THX!!!!!!!!!!
*worked

Offline

#15 2015-05-12 20:38:22

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: Already joined players

benedani wrote:

YES IT WROKED*!!! OMG THX!!!!!!!!!!
*worked

You can also get things like old messages, the status of all switches for all players and some other stuff I don't know out of my head.

Offline

den31071431459502504063

Board footer

Powered by FluxBB

[ Started around 1732484993.0194 - Generated in 0.046 seconds, 12 queries executed - Memory usage: 1.48 MiB (Peak: 1.63 MiB) ]