Пример #1
0
        private void ISetPlayer()
        {
            pnCli2Vault_PlayerSetRequest req = new pnCli2Vault_PlayerSetRequest();
            req.Read(fStream);

            pnVault2Cli_PlayerSetReply reply = new pnVault2Cli_PlayerSetReply();
            reply.fTransID = req.fTransID;

            // Make sure that player is on this account
            try {
                pnSqlSelectStatement selAcctIdx = new pnSqlSelectStatement();
                selAcctIdx.AddColumn("Idx");
                selAcctIdx.AddColumn("Permissions");
                selAcctIdx.AddWhere("Guid", req.fAcctGuid);
                selAcctIdx.Table = "Accounts";

                IDataReader rAcctIdx = selAcctIdx.Execute(fDb);
                if (rAcctIdx.Read()) {
                    uint acctIdx = Convert.ToUInt32(rAcctIdx["Idx"]);
                    int perms = Convert.ToInt32(rAcctIdx["Permissions"]);
                    rAcctIdx.Close();

                    pnSqlSelectStatement selPlayer = new pnSqlSelectStatement();
                    selPlayer.AddColumn("COUNT(*)");
                    selPlayer.AddWhere("AcctIdx", acctIdx);
                    selPlayer.Table = "Players"; ;

                    IDataReader rPlayer = selPlayer.Execute(fDb);
                    if (rPlayer.Read())
                        reply.fResult = ENetError.kNetSuccess;
                    else
                        reply.fResult = ENetError.kNetErrPlayerNotFound;
                    rPlayer.Close();
                } else {
                    reply.fResult = ENetError.kNetErrPlayerNotFound;
                    rAcctIdx.Close();
                }
            } catch (pnDbException e) {
                reply.fResult = ENetError.kNetErrInternalError;
                Error(e, "SetActivePlayer Failed");
            }

            reply.Send(fStream);
        }
Пример #2
0
 private void IPlayerSet()
 {
     pnVault2Cli_PlayerSetReply reply = new pnVault2Cli_PlayerSetReply();
     reply.Read(fStream);
     FireCallback(reply.fTransID, new object[] { reply.fResult, null });
 }