Exemple #1
0
 private void OnPlayerConnected(Network.Message packet)
 {
     if (rustWeb != null)
     {
         rustWeb.OnPlayerConnected(packet);
     }
 }
Exemple #2
0
 private void OnPlayerConnected(Network.Message packet)
 {
     if (timers.ContainsKey(packet.connection.userid))
     {
         timers[packet.connection.userid].Destroy();
     }
 }
Exemple #3
0
 private void OnPlayerConnected(Network.Message packet)
 {
     if ((bool)Config["ReplaceWithFirstName"] && data.Players.Count > 0)
     {
         if (nameChangeData != null)
         {
             foreach (KeyValuePair <string, object> item in nameChangeData)
             {
                 if (Convert.ToUInt64(item.Key) != packet.connection.userid)
                 {
                     foreach (Player dataPlayer in data.Players)
                     {
                         if (packet.connection.userid == dataPlayer.userID)
                         {
                             packet.connection.username = dataPlayer.Names.First();
                             goto end;
                         }
                     }
                 }
             }
             end :;
         }
         else
         {
             foreach (Player dataPlayer in data.Players)
             {
                 if (packet.connection.userid == dataPlayer.userID)
                 {
                     packet.connection.username = dataPlayer.Names.First();
                     break;
                 }
             }
         }
     }
 }
Exemple #4
0
        static void Main(string[] args)
        {
            int ServerPort = -1;

            Network.Server MyServer;

            //Actual game stuff
            Deck          deck              = new Deck();          //Current deck to deal from
            List <Player> Players           = new List <Player>(); //List of players
            int           round             = 0;
            bool          dealt             = false;               //Have I dealt for this round?
            int           responsesReceived = 0;                   //Responses received this round.

            //Debug
            ServerPort = 3000;//Port I'm listening to

            Console.WriteLine("OpenCards Testing Server\n");

            MyServer = new Network.Server(ServerPort);


            while (true) //Main game loop
            {
                #region  //Check for and deal with messages
                Network.Message tempMessage = MyServer.GetNextMessage();
                if (tempMessage != null)
                {
                    //Console.WriteLine(tempMessage.Sender);
                    if (tempMessage.PayloadType == typeof(Deck))
                    {
                        Deck tempDeck = (Deck)tempMessage.Payload;
                        deck.Add(tempDeck);
                        Console.WriteLine("Got a deck from " + tempDeck.Sender.Name + " at " + tempDeck.Sender.IP);
                    }
                    else if (tempMessage.PayloadType == typeof(Player))
                    {
                        Player tempPlayer = (Player)tempMessage.Payload;
                        Players.Add(tempPlayer);
                        //Console.WriteLine(tempPlayer.ToString());
                    }
                    else if (tempMessage.PayloadType == typeof(Response))
                    {
                        Response tempResponse = (Response)tempMessage.Payload;
                        Console.WriteLine(tempResponse.ToString());
                    }
                }
                #endregion

                //If haven't dealt, deal

                //If all responses have come in, send responses to all players

                //If last Response came from Czar and all responses have been received, notify all players of the round winner, send Gamestate to all players
            }



            //End of Main
        }
Exemple #5
0
        void OnPlayerConnected(Network.Message packet)
        {
            var player = packet.Player();

            if (player)
            {
                OnPlayerInit(player);
            }
        }
Exemple #6
0
        void OnClientAuth(Network.Message pack)
        {
            if (pack.connection == null)
            {
                return;
            }

            Puts($"{pack.connection.userid} joined with protocol {pack.connection.protocol}");
            pack.connection.protocol = Rust.Protocol.network;
        }
Exemple #7
0
        void OnPlayerConnected(Network.Message packet)
        {
            if (!logConnections)
            {
                return;
            }
            var con = packet.connection;

            Log("connections", Lang("Connected", null, con.username, con.userid, IpAddress(con.ipaddress)));
        }
Exemple #8
0
        void OnPlayerConnected(Network.Message packet)
        {
            //int agora = global.BasePlayer.activePlayerList.Count;
            var payload = new BotPayload
            {
                numeroDePLayersAgora = $"{BasePlayer.activePlayerList.Count}",
                numeroDePlayersTotal = $"{maximoDePlayers}"
            };

            NotificarBot(payload);
        }
Exemple #9
0
        void OnPlayerConnected(Network.Message packet)
        {
            if (config.player_notifications.enabled)
            {
                Announce(config.player_notifications.message_online, config.player_notifications.message_color, 14);
            }

            // Post wipe info when a player connects
            if (config.server_info.wipe_info_enabled)
            {
                Announce(config.server_info.wipe_info_message, config.server_info.wipe_info_message_color, 14);
            }
        }
Exemple #10
0
 void OnPlayerConnected(Network.Message packet)
 {
     if (Config.Get <bool>("ReplaceWithFirstName"))
     {
         foreach (PlayerData dataPlayer in data.Players)
         {
             if (packet.connection.userid == dataPlayer.userID)
             {
                 packet.connection.username = dataPlayer.Names.First();
                 break;
             }
         }
     }
 }
Exemple #11
0
 void OnPlayerConnected(Network.Message packet)
 {
     if (BasePlayer.activePlayerList.Count == 0)
     {
         if (UseFPSLimit)
         {
             ServerNotEmpty_FPSLimit();
         }
         if (UseTickrate)
         {
             ServerNotEmpty_Tickrate();
         }
     }
 }
Exemple #12
0
        private void RemoteClientConnected(Network.Message msg)
        {
            playerCount++;

            Invoke((MethodInvoker) delegate
            {
                info.Text = playerCount + " db játékos kész";

                if (playerCount == maxPlayerCount)
                {
                    GameService.NetworkManager.UnbindCommand("REMOTE_CONNECTED");
                    DialogResult = DialogResult.Yes;
                }
            });
        }
Exemple #13
0
        /// <summary>
        /// Called when a player connects
        /// </summary>
        /// <param name="packet"></param>
        void OnPlayerConnected(Network.Message packet)
        {
            // Add the player to the list
            if (!ids.Exists(x => x.Equals(packet.connection.userid.ToString())))
            {
                ids.Add(packet.connection.userid.ToString());

                if (VerboseMode)
                {
                    Puts("OnPlayerConnected => " + packet.connection.userid.ToString() + " added to ids list");
                }

                if (LogVerbose)
                {
                    Log("OnPlayerConnected => " + packet.connection.userid.ToString() + " added to ids list");
                }
            }
        }
Exemple #14
0
        public bool Send(Network.Message obj, int channelId = 1)
        {
            Logger.Error("send message:" + obj.ProtocolId);
            if (!isConnected())
            {
                return(false);
            }

            this.channelId = channelId;

            if (handlerPipeline.OutHeader != null)
            {
                handlerPipeline.OutHeader.Send(this, obj);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #15
0
        void OnPlayerConnected(Network.Message packet)
        {
            var connection = packet.connection;

            server.Broadcast(GetMessage("PlayerJoined", connection.username).Replace("{name}", connection.username));
        }
Exemple #16
0
 private void OnPlayerConnected(Network.Message packet)
 {
     HookCalled("OnPlayerConnected");
     Puts($"{packet.connection.username} ({packet.connection.userid}) connected!");
 }
Exemple #17
0
 void OnPlayerConnected(Network.Message packet)
 {
     //Put kit
 }
Exemple #18
0
 public void Recv(Network.Message msg)
 {
     queue.Enqueue(msg);
 }
Exemple #19
0
        void OnPlayerConnected(Network.Message packet)
        {
            var userId = packet.connection.userid;

            AddShopPlayer(userId);
        }
Exemple #20
0
        void OnPlayerConnected(Network.Message packet)
        {
            var con = packet.connection;

            LogToFile("connections", Lang("Connected", null, con.username, con.userid, IpAddress(con.ipaddress)));
        }
Exemple #21
0
 void Recieve(Network.Message msg)
 {
     Reciever.Recv(msg);
 }
Exemple #22
0
 void OnPlayerConnected(Network.Message packet)
 {
     Puts("OnPlayerConnected works!");
 }
Exemple #23
0
 void OnPlayerConnected(Network.Message packet)
 {
     IsCountryBlocked(packet.connection.username, packet.connection.userid.ToString(), IpAddress(packet.connection.ipaddress));
 }
Exemple #24
0
        void mClient_AnswerReceived(Network.Message aMessage)
        {
            if (App.REST == null)
            {
                var server = string.Empty;
                var port   = -1;
                var path   = string.Empty;

                foreach (var answer in aMessage.Answers)
                {
                    switch (answer.Type)
                    {
                    case Network.Type.PTR:
                    {
                        var name = ((Network.Ptr)answer.ResponseData).DomainName.ToString();

                        if (string.Compare(name, "openHAB._openhab-server._tcp.local", StringComparison.InvariantCultureIgnoreCase) != 0)
                        {
                            return;
                        }
                    }
                    break;

                    case Network.Type.A:
                    case Network.Type.AAAA:
                        server = ((Network.HostAddress)answer.ResponseData).Address.ToString();
                        break;

                    case Network.Type.TXT:
                        if (((Network.Txt)answer.ResponseData).Properties.ContainsKey("uri"))
                        {
                            path = ((Network.Txt)answer.ResponseData).Properties["uri"];
                        }
                        break;

                    case Network.Type.SRV:
                        port = ((Network.Srv)answer.ResponseData).Port;
                        break;
                    }
                }

                if (port == -1 || string.IsNullOrWhiteSpace(server) || string.IsNullOrWhiteSpace(path))
                {
                    return;
                }

                var uri = new UriBuilder("http", server, port, path).Uri;

                if (mFoundServerList.Any(s => s.Uri == uri))
                {
                    return;
                }
                if (mLocalServerList.Any(s => s.Uri == uri))
                {
                    return;
                }

                Dispatcher.BeginInvoke(() =>
                {
                    mFoundServerList.Add(new Server(this, server, new UriBuilder("http", server, port).Uri.AbsoluteUri, uri));
                });
            }
        }