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 2019-02-14 19:32:51

Anemone123
Banned
Joined: 2019-02-14
Posts: 6

Console connection code

var client = PlayerIO.QuickConnect.SimpleConnect("everybody-edits-su9rn58o40itdbnw69plyw", "Email", "Password", null);
            var connection = client.Multiplayer.JoinRoom("WorldID", null);

            connection.OnDisconnect += (s, m) => Console.WriteLine(m);
            connection.OnMessage += (s, m) => {
                if (m.Type == "init") {
                    connection.Send("say", "hello");
                    connection.Send("init2");
                }

                Console.WriteLine(m);
            };

            connection.Send("init");

            Thread.Sleep(-1);

I like it, as it is very light and does not require much time. It's very easy to use because all you need to do is write your data in a specific section.

Offline

#2 2019-02-15 11:21:22

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

Re: Console connection code

Is this a tutorial or help topic?

There is no error checking for connection or client. And instead of "if (m.Type == "init")" you could use switches instead.
Also "connection.OnDisconnect += (s, m) => Console.WriteLine(m);" need braces.

Offline

capasha1550226082741017

Board footer

Powered by FluxBB

[ Started around 1732186498.9924 - Generated in 0.024 seconds, 10 queries executed - Memory usage: 1.33 MiB (Peak: 1.41 MiB) ]