Ejemplo n.º 1
0
 private void IVaultNodeFetched()
 {
     pnAuth2Cli_VaultNodeFetched reply = new pnAuth2Cli_VaultNodeFetched();
     reply.Read(fStream);
     FireCallback(reply.fTransID, new object[] { reply.fResult, reply.fNode, null });
 }
Ejemplo n.º 2
0
        private void IOnNodeFetched(ENetError result, pnVaultNode node, object param)
        {
            pnAuth2Cli_VaultNodeFetched reply = new pnAuth2Cli_VaultNodeFetched();
            reply.fTransID = (uint)param;

            if (result == ENetError.kNetSuccess &&
                node != null && fPermissions < pnAcctPerms.CCR) {
                switch (node.NodeType) {
                    case ENodeType.kNodeAdmin:
                    case ENodeType.kNodeCCR:
                    case ENodeType.kNodeGameServer:
                    case ENodeType.kNodeInvalid:
                    case ENodeType.kNodeUNUSED:
                    case ENodeType.kNodeVaultServer:
                    case ENodeType.kNodeVNodeMgrHigh:
                    case ENodeType.kNodeVNodeMgrLow:
                        reply.fResult = ENetError.kNetErrVaultNodeAccessViolation;
                        break;
                    case ENodeType.kNodeAgeInfoList:
                        pnVaultAgeInfoListNode ages = new pnVaultAgeInfoListNode(node);
                        if (ages.FolderType == EStandardNode.kPublicAgesFolder)
                            reply.fResult = ENetError.kNetErrVaultNodeAccessViolation;
                        break;
                    case ENodeType.kNodeFolder:
                        // Yay, moar switching
                        pnVaultFolderNode folder = new pnVaultFolderNode(node);
                        switch (folder.FolderType) {
                            case EStandardNode.kAllAgeGlobalSDLNodesFolder:
                            case EStandardNode.kGameScoresFolder: // Currently unused
                            case EStandardNode.kVaultMgrGlobalDataFolder:
                                reply.fResult = ENetError.kNetErrVaultNodeAccessViolation;
                                break;
                        }
                        break;
                    case ENodeType.kNodePlayer:
                        if (fPlayerID != node.CreatorID)
                            reply.fResult = ENetError.kNetErrVaultNodeAccessViolation;
                        break;
                    case ENodeType.kNodePlayerInfoList:
                        pnVaultPlayerInfoListNode players = new pnVaultPlayerInfoListNode(node);
                        switch (players.FolderType) {
                            case EStandardNode.kAllPlayersFolder:
                            case EStandardNode.kCCRPlayersFolder: // Currently unused
                                reply.fResult = ENetError.kNetErrVaultNodeAccessViolation;
                                break;
                        }
                        break;
                    case ENodeType.kNodeSDL:
                        pnVaultSDLNode sdl = new pnVaultSDLNode(node);
                        if (sdl.StateIdent != EStandardNode.kAgeInstanceSDLNode)
                            reply.fResult = ENetError.kNetErrVaultNodeAccessViolation;
                        break;
                    default:
                        reply.fResult = result;
                        break;
                }
            } else
                reply.fResult = result;

            if (result == ENetError.kNetSuccess)
                reply.fNode = node;
            reply.Send(fStream);
        }