Пример #1
0
        private static void PreSavePlayer(PacketContent pc)
        {
            //byte[] temp = data.getContent();
            //AccountsManager.SavePacket("davemax", ref temp);
            AccountsManager file = new AccountsManager(_form);
            string playerLoginName = pc.ReadString();
            Player playerToSave = new Player(0);
            DebuffPlayer(pc, ref playerToSave);
            file.SavePlayer(playerLoginName, ref playerToSave);

            Bank bankToSave = new Bank(0);
            DebuffBank(pc, ref bankToSave);
            file.SavePlayerBank(playerLoginName, ref bankToSave);

            if (!updatingPlayers) appendLog(playerLoginName + "'s account & bank saved.");
            else updatedPlayerList += playerLoginName + ", ";
        }
Пример #2
0
 private static void RegisterServer(PacketContent pc, ServerDetails serverDetails)
 {
     appendLog(".::Received server connection::. ");
     serverDetails.serverIndex = pc.ReadLong();
     serverDetails.name = pc.ReadString();
     serverDetails.ip = pc.ReadString();
     serverDetails.port = pc.ReadLong();
     serverDetails.location = pc.ReadString();
     serverDetails.donorOnly = pc.ReadFlag();
     serverDetails.registered = true;
     appendLog(".::Name: " + serverDetails.name);
     appendLog(".::IP: " + serverDetails.ip);
     appendLog(".::Port: " + serverDetails.port);
 }
Пример #3
0
 private static void CheckAdmission(PacketContent data)
 {
     string loginName = data.ReadString();
     GamePlayerAdmission status = (GamePlayerAdmission)data.ReadLong();
     switch (status)
     {
         case GamePlayerAdmission.Accepted:
             AllowPlayerToJoinTheServer(loginName);
             break;
         case GamePlayerAdmission.Rejected_Multilogin:
             appendLog("Server has rejected " + loginName + " due to multilogin attempt!");
             PlayerClient.PlayerRejected(loginName, "Multiple logins are not authorized.");
             break;
         case GamePlayerAdmission.Rejected_TooManyPlayers:
             appendLog("Server has rejected " + loginName + " due to max players limit!");
             PlayerClient.PlayerRejected(loginName, "Theres too many players in game. Please try again later.");
             break;
         default:
             break;
     }
 }