Exemplo n.º 1
0
        public static void HandleLoginPositionRequest(int index, string playerID)
        {
            Point position = CommonMongo.GetEntityCoordinates(playerID);

            ServerTCP.InitializeClient(index, position.X, position.Y, playerID);
            ServerOutput.Compose(Outbound.PCLoginPositionRequest, index, position);
            ServerTCP.clients[index].MovePosition(position.X, position.Y);
            CommonMongo.SetEntityCoodinates(position.X, position.Y, ServerTCP.clients[index].properties.ID);
        }
Exemplo n.º 2
0
        public static void HandleAccountCreateQuery(int index, string username, string password)
        {
            bool userExists = CommonMongo.DoesUserExist(username);

            if (userExists)
            {
                ServerOutput.Compose(Outbound.Account_Create_Fail, index, Log.DatabaseAccountAlreadyExists);
                return;
            }

            CommonMongo.CreateAccount(username, password);
            ServerOutput.Compose(Outbound.Account_Create_Success, index, Log.DatabaseAccountCreated);
        }
Exemplo n.º 3
0
        internal static void HandleLoginChunkRequest(int index, int x, int y)
        {
            List <DBPackages.DBTile> tiles = CommonMongo.GetChunkData(x, y);

            ServerOutput.ComposeChunk(Outbound.LoginChunkRequest, index, tiles);
        }
Exemplo n.º 4
0
        public static void HandleDoesUserExist(int index, string username)
        {
            var result = CommonMongo.DoesUserExist(username);

            ServerOutput.Compose(Outbound.DoesUserExist, index, result ? false : true);
        }
Exemplo n.º 5
0
 public static void HandlePlayerCharacterMovedPosition(int index, int x, int y)
 {
     ServerTCP.clients[index].MovePosition(x, y);
     CommonMongo.SetEntityCoodinates(x, y, ServerTCP.clients[index].properties.ID);
 }