Example #1
0
        private static void AppendConnect(CMsgConnect connect, GameClient client)
        {
            client.CreatedUID = connect.Identifier;
            GameClient confirmationClient;

            // Prevent logged on clients to login again.
            if (client.MyServer.ConfirmationPool.TryRemove(connect.Identifier, out confirmationClient) ||
                client.MyServer.GamePool.TryRemove(connect.Identifier, out confirmationClient))
            {
                confirmationClient.Disconnect();
                client.Send(new CMsgTalk(Color.Orange, ChatType.Dialog, "You're already logged in.", "", "ALLUSERS"));
                client.Disconnect();
                return;
            }
            if (!client.IsCreating)
            {
                client.MyServer.ConfirmationPool.TryAdd(connect.Identifier, client);
            }
            else
            {
                client.IsCreating = false;
            }
            if (!PlayerTable.Load(client.CreatedUID, ref client.Player, client.MyServer))
            {
                client.IsCreating = true;
                client.Send(new CMsgTalk(Color.Orange, ChatType.Dialog, "NEW_ROLE", "", "ALLUSERS"));
                return;
            }
            // BELOW IS ONLY IF THE ACCOUNT IS VALID
            client.Send(new CMsgTalk(Color.Orange, ChatType.Dialog, "ANSWER_OK", "", "ALLUSERS"));
            client.Send(new CMsgUserInfo(client.Player));
            client.MyServer.ConfirmationPool.TryRemove(connect.Identifier, out confirmationClient);
        }
Example #2
0
 private void Awake()
 {
     instance    = this;
     playerTable = new PlayerTable();
     playerTable.Load(csv);
     foreach (var iter in playerTable.GetRowList())
     {
         PlayerInfo info = new PlayerInfo(iter.Level, iter.MaxExp, iter.MissileCount);
         playerInfoList.Add(info);
     }
 }