public void SendAccount()
    {
        KaymakGames.KaymakGames buffer = new KaymakGames.KaymakGames();
        buffer.WriteInteger(1);

        if (_username.text == string.Empty)
        {
            Debug.Log("Please insert a username.");
            return;
        }

        if (_password.text == string.Empty)
        {
            Debug.Log("Please insert a password.");
            return;
        }

        if (_password2.text != _password.text)
        {
            Debug.Log("Your password do not match.");
            return;
        }

        buffer.WriteString(_username.text);
        buffer.WriteString(_password.text);

        SendDataToServer(buffer.ToArray());
        buffer = null;
    }
 public void SendLogin()
 {
     KaymakGames.KaymakGames buffer = new KaymakGames.KaymakGames();
     buffer.WriteInteger((int)Enumerations.ClientPackets.CHandleLogin);
     buffer.WriteString(_loginUser.text);
     buffer.WriteString(_loginPass.text);
     SendDataToServer(buffer.ToArray());
     buffer = null;
 }
 public void SendNewAccount()
 {
     KaymakGames.KaymakGames buffer = new KaymakGames.KaymakGames();
     buffer.WriteInteger((int)Enumerations.ClientPackets.CNewAccount);
     buffer.WriteString(_username.text);
     buffer.WriteString(_password.text);
     SendDataToServer(buffer.ToArray());
     buffer = null;
 }
    public void SendLogin()
    {
        KaymakGames.KaymakGames buffer = new KaymakGames.KaymakGames();

        buffer.WriteInteger(2);
        buffer.WriteString(_loginUser.text);
        buffer.WriteString(_loginPass.text);

        SendDataToServer(buffer.ToArray());
        buffer = null;
    }
    public void SendNewAccount()
    {
        KaymakGames.KaymakGames buffer = new KaymakGames.KaymakGames();

        buffer.WriteInteger(1);
        buffer.WriteString(_username.text);
        buffer.WriteString(_password.text);

        SendDataToServer(buffer.ToArray());
        buffer = null;
    }
Esempio n. 6
0
        public void SendMatchMaking(int room)
        {
            KaymakGames.KaymakGames buffer = new KaymakGames.KaymakGames();
            buffer.WriteInteger(3);
            buffer.WriteString(Network.Player[RoomInstance._room[room].player[0]].Username);
            buffer.WriteString(Network.Player[RoomInstance._room[room].player[1]].Username);
            SendDataToRoom(room, buffer.ToArray());
            buffer = null;

            Network.TempPlayer[RoomInstance._room[room].player[0]].inMatch = true;
            Network.TempPlayer[RoomInstance._room[room].player[1]].inMatch = true;
        }
Esempio n. 7
0
        public void SendIngame(int index)
        {
            KaymakGames.KaymakGames buffer = new KaymakGames.KaymakGames();
            buffer.WriteInteger(1);

            //Player Data
            buffer.WriteString(Network.Player[index].Username);
            buffer.WriteString(Network.Player[index].Password);
            buffer.WriteInteger(Network.Player[index].Level);
            buffer.WriteByte(Network.Player[index].Access);
            buffer.WriteByte(Network.Player[index].FirstTime);

            SendDataTo(index, buffer.ToArray());
            buffer = null;
        }
Esempio n. 8
0
        public void SendAlertMsg(int index, string alertMsg)
        {
            KaymakGames.KaymakGames buffer = new KaymakGames.KaymakGames();
            buffer.WriteInteger((int)Enumerations.ServerPackets.SAlertMsg);
            buffer.WriteString(alertMsg);

            SendDataTo(index, buffer.ToArray());
        }
Esempio n. 9
0
        public void SendAlertMsg(int index, string alertMsg)
        {
            KaymakGames.KaymakGames buffer = new KaymakGames.KaymakGames();

            buffer.WriteInteger(1);
            buffer.WriteString(alertMsg);

            SendDataTo(index, buffer.ToArray());
        }
    public void SendLogin()
    {
        KaymakGames.KaymakGames buffer = new KaymakGames.KaymakGames();
        buffer.WriteInteger(2);

        if (_loginUsername.text == string.Empty)
        {
            Debug.Log("Please insert a username.");
            return;
        }

        if (_loginPassword.text == string.Empty)
        {
            Debug.Log("Please insert a password.");
            return;
        }

        buffer.WriteString(_loginUsername.text);
        buffer.WriteString(_loginPassword.text);

        SendDataToServer(buffer.ToArray());
        buffer = null;
    }
Esempio n. 11
0
        public byte[] PlayerData(int index)
        {
            KaymakGames.KaymakGames buffer = new KaymakGames.KaymakGames();

            // prevent out of bounds
            if (index > Constants.MAX_PLAYERS)
                return null;

            buffer.WriteInteger((int)Enumerations.ServerPackets.SPlayerData);
            buffer.WriteInteger(index);
            buffer.WriteFloat(Globals.general.GetPlayerX(index));
            buffer.WriteFloat(Globals.general.GetPlayerY(index));
            buffer.WriteFloat(Globals.general.GetPlayerZ(index));

            buffer.WriteString(Globals.player[index].Username);
            return buffer.ToArray();
        }