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.
I don't know why, this never happened before.
I tried
con = client.Multiplayer.CreateJoinRoom("PWkbrKJ-ZhcUI", "public", true, new Dictionary<string, string>(), new Dictionary<string, string>());
but it didn't work.
I also tried
object version = client.BigDB.Load("config", "config")["version"];
con = client.Multiplayer.CreateJoinRoom("PWkbrKJ-ZhcUI", "Everybodyedits" + version, true, new Dictionary<string, string>(), new Dictionary<string, string>());
No exceptions, but it didn't connect to my world. (no extra clients opened)
What should I do now?
Offline
I believe it's a little more complicated than that. I'll try to explain.
In essence, CreateJoinRoom is essentially a mix between CreateRoom and JoinRoom. If the room doesn't exist already, you need to specify the room type. If not, the server will tell you to join the first one it finds with the room ID you specify. If you look at the documentation, the JoinRoom request does not require a RoomType, however CreateRoom does. It is a fallback method.
*u stinky*
Offline
Are you sure you're doing everything else correctly? You also need to be sending init and init2 if you want to actually connect to the world.
I put init2 and init in my code.
It should send init2 after init. I made a console app and made it so I can see if connected or not.
It connected, but it didn't send a message and didn't join as well.
I believe it's a little more complicated than that. I'll try to explain.
In essence, CreateJoinRoom is essentially a mix between CreateRoom and JoinRoom. If the room doesn't exist already, you need to specify the room type. If not, the server will tell you to join the first one it finds with the room ID you specify. If you look at the documentation, the JoinRoom request does not require a RoomType, however CreateRoom does. It is a fallback method.
So if I use JoinRoom, and enter my world ID will it work?
I will give it a shot.
Offline
You should be able to join with CreateJoinRoom provided you specify the proper room type, which you have correctly shown in the first post; 'Everybodyeditts' + version
A few things to check off:
- are you able to join a world with the account using the flash client?
- is the account you're using a linked account?
- are you able to use another account to connect with the code you are using?
It would also help if you posted the full source code with the account details omitted.
*u stinky*
Offline
You should be able to join with CreateJoinRoom provided you specify the proper room type, which you have correctly shown in the first post; 'Everybodyeditts' + version
A few things to check off:
- are you able to join a world with the account using the flash client?
- is the account you're using a linked account?
- are you able to use another account to connect with the code you are using?It would also help if you posted the full source code with the account details omitted.
It's all in one file.
I've removed the unnecessary namespaces by the way.
------ EDIT ------
( ) I've also tried with Everybodyedits + version thingy, it connected successfully but didn't join the world aswell.
( ) I was trying it with my main account to join to MY world. And no, it didn't work out very well.
( ) <silent>
Offline
You have several issues with the code you posted.
You should try the following:
static Client client { get; set; }
static Connection con { get; set; }
static void Main(string[] args)
{
client = PlayerIO.QuickConnect.SimpleConnect("everybody-edits-su9rn58o40itdbnw69plyw", "email", "password", null);
con = client.Multiplayer.CreateJoinRoom("world-id", "Everybodyedits" + client.BigDB.Load("config", "config")["version"], true, null, null);
con.OnMessage += (s, e) =>
{
if (e.Type == "init")
{
con.Send("init2");
}
if (e.Type == "say")
{
if (e.GetString(1).StartsWith("!ping"))
{
con.Send("say", "/pm username message");
}
}
};
con.Send("init");
Console.ReadLine();
}
*u stinky*
Offline
You have several issues with the code you posted.
You should try the following:static Client client { get; set; } static Connection con { get; set; } static void Main(string[] args) { client = PlayerIO.QuickConnect.SimpleConnect("everybody-edits-su9rn58o40itdbnw69plyw", "email", "password", null); con = client.Multiplayer.CreateJoinRoom("world-id", "Everybodyedits" + client.BigDB.Load("config", "config")["version"], true, null, null); con.OnMessage += (s, e) => { if (e.Type == "init") { con.Send("init2"); } if (e.Type == "say") { if (e.GetString(1).StartsWith("!ping")) { con.Send("say", "/pm username message"); } } }; con.Send("init"); Console.ReadLine(); }
So, is CreateJoinRoom necessary? I connected with the JoinRoom.
Or I really need the lambda expression?
Connect and Client should be property?
If I missed the Connection and Client, that's okay but when I connect it, well, it doesn't even show up even after I sent "init2".
So I need to use CreateJoinRoom.
-----
Therefore, pretty ridiculous, it worked with other bots yet not with this bot.
I created a PlayerIO server myself, and I can't even either rename, or delete the "public" connection.
Perhaps only higher subscriptions lets you to do that?
Offline
CreateJoinRoom does two things, first it creates a room with the given room type if it doesn't exist already, and second it joins that room. This means that you don't need it if the room is already open (so giving it the wrong room type doesn't break anything as it doesn't use it), but if the room is closed then the create part is needed, and the room type matters.
And most of the code that Atilla changed doesn't need to be changed, I guess he just decided it looks nicer
The properties, inlining of version, lambda function, nulls instead of empty dictionaries, different way of handling commands, and alternate version of PM aren't needed, but the response to init and correct room types are.
Offline
[ Started around 1733253553.7751 - Generated in 0.080 seconds, 12 queries executed - Memory usage: 1.51 MiB (Peak: 1.67 MiB) ]