示例#1
0
        protected virtual void OnMsgStartInfo(BasePlayer player,
                                              GameMsg_ClStartInfo msg)
        {
            if (player.IsReady)
            {
                return;
            }

            player.IsReady        = true;
            player.LastChangeInfo = Server.Tick;

            Server.SetClientName(player.ClientId, msg.Name);
            Server.SetClientClan(player.ClientId, msg.Clan);
            Server.SetClientCountry(player.ClientId, msg.Country);

            player.TeeInfo.SkinName       = msg.Skin;
            player.TeeInfo.UseCustomColor = msg.UseCustomColor;
            player.TeeInfo.ColorBody      = msg.ColorBody;
            player.TeeInfo.ColorFeet      = msg.ColorFeet;

            GameController.OnPlayerInfoChange(player);

            // send all votes

            SendTuningParams(player.ClientId);
            Server.SendPackMsg(new GameMsg_SvReadyToEnter(),
                               MsgFlags.VITAL | MsgFlags.FLUSH, player.ClientId);
        }
示例#2
0
        protected override void OnMsgClientStartInfo(BasePlayer player, GameMsg_ClStartInfo startInfo)
        {
            if (player.IsReadyToEnter)
            {
                return;
            }

            Server.ClientName(player.ClientId, startInfo.Name.Limit(BaseServerClient.MaxNameLength));
            Server.ClientClan(player.ClientId, startInfo.Clan.Limit(BaseServerClient.MaxClanLength));
            Server.ClientCountry(player.ClientId, startInfo.Country);

            for (var i = SkinPart.Body; i < SkinPart.NumParts; i++)
            {
                player.TeeInfo[i].Name           = startInfo.SkinPartNames[(int)i];
                player.TeeInfo[i].Color          = startInfo.SkinPartColors[(int)i];
                player.TeeInfo[i].UseCustomColor = startInfo.UseCustomColors[(int)i];
            }

            PlayerInfoChanged?.Invoke(player);
            SendTuningParams(player.ClientId);
            player.ReadyToEnter();
        }
示例#3
0
 protected abstract void OnMsgClientStartInfo(BasePlayer player, GameMsg_ClStartInfo startInfo);