Exemple #1
0
        private void HandleLcRequestCreateAccount(Message m)
        {
            LcRequestCreateAccount msg = m as LcRequestCreateAccount;

            if (!OnPreAllowCreateAccount(msg.login, msg.passwordHash, msg.email, msg.promotionCode))
            {
                server.Send(msg.sourceClient, new LsCreateAccountReply(false), Lidgren.Network.NetDeliveryMethod.ReliableOrdered);

                Debug.Log("Login Server: failed to create account");
                return;
            }

            bool result = accountDatabase.CreateAccount(msg.login, msg.passwordHash, msg.email, msg.promotionCode);

            server.Send(msg.sourceClient, new LsCreateAccountReply(result), Lidgren.Network.NetDeliveryMethod.ReliableOrdered);

            OnAccountCreated(msg.login, msg.passwordHash, msg.email, msg.promotionCode);
        }
Exemple #2
0
        private ulong AddPlayer(ushort client)
        {
            ulong owner = nextOwnerId++;

            if (isServer && IsClientLocal(client))
            {
                owner = ServerOwnerID;
            }

            serverObject.Send(client, new UMsgSetOwner(owner), NetDeliveryMethod.ReliableOrdered);

            players.Add(owner, client);
            clientOwners.Add(client, owner);

            Debug.Log("AddPlayer client=" + client + ", owner=" + owner);

            serverObject.SendToAll(new UMsgAddPlayer(owner, client), Lidgren.Network.NetDeliveryMethod.ReliableOrdered);

            return(owner);
        }