コード例 #1
0
        void ProcessReceivedMessage_NotifyPlayerLeave(Nettention.Proud.Message __msg, Nettention.Proud.ReceivedMessage pa, Object hostTag, Nettention.Proud.HostID remote)
        {
            Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
            ctx.sentFrom     = pa.RemoteHostID;
            ctx.relayed      = pa.IsRelayed;
            ctx.hostTag      = hostTag;
            ctx.encryptMode  = pa.EncryptMode;
            ctx.compressMode = pa.CompressMode;

            int  groupID; SngClient.Marshaler.Read(__msg, out groupID);
            int  idx; SngClient.Marshaler.Read(__msg, out idx);
            bool changeMaster; SngClient.Marshaler.Read(__msg, out changeMaster);
            int  newMasterID; SngClient.Marshaler.Read(__msg, out newMasterID);

            core.PostCheckReadMessage(__msg, RmiName_NotifyPlayerLeave);
            if (enableNotifyCallFromStub == true)
            {
                string parameterString = "";
                parameterString += groupID.ToString() + ",";
                parameterString += idx.ToString() + ",";
                parameterString += changeMaster.ToString() + ",";
                parameterString += newMasterID.ToString() + ",";
                NotifyCallFromStub(Common.NotifyPlayerLeave, RmiName_NotifyPlayerLeave, parameterString);
            }

            if (enableStubProfiling)
            {
                Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                summary.rmiID   = Common.NotifyPlayerLeave;
                summary.rmiName = RmiName_NotifyPlayerLeave;
                summary.hostID  = remote;
                summary.hostTag = hostTag;
                BeforeRmiInvocation(summary);
            }

            long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

            // Call this method.
            bool __ret = NotifyPlayerLeave(remote, ctx, groupID, idx, changeMaster, newMasterID);

            if (__ret == false)
            {
                // Error: RMI function that a user did not create has been called.
                core.ShowNotImplementedRmiWarning(RmiName_NotifyPlayerLeave);
            }

            if (enableStubProfiling)
            {
                Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                summary.rmiID       = Common.NotifyPlayerLeave;
                summary.rmiName     = RmiName_NotifyPlayerLeave;
                summary.hostID      = remote;
                summary.hostTag     = hostTag;
                summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                AfterRmiInvocation(summary);
            }
        }
コード例 #2
0
        void ProcessReceivedMessage_Player_2Point(Nettention.Proud.Message __msg, Nettention.Proud.ReceivedMessage pa, Object hostTag, Nettention.Proud.HostID remote)
        {
            Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
            ctx.sentFrom     = pa.RemoteHostID;
            ctx.relayed      = pa.IsRelayed;
            ctx.hostTag      = hostTag;
            ctx.encryptMode  = pa.EncryptMode;
            ctx.compressMode = pa.CompressMode;

            UnityEngine.Vector3 point; SngClient.Marshaler.Read(__msg, out point);
            float rotation; SngClient.Marshaler.Read(__msg, out rotation);
            int   run; SngClient.Marshaler.Read(__msg, out run);

            core.PostCheckReadMessage(__msg, RmiName_Player_2Point);
            if (enableNotifyCallFromStub == true)
            {
                string parameterString = "";
                parameterString += point.ToString() + ",";
                parameterString += rotation.ToString() + ",";
                parameterString += run.ToString() + ",";
                NotifyCallFromStub(Common.Player_2Point, RmiName_Player_2Point, parameterString);
            }

            if (enableStubProfiling)
            {
                Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                summary.rmiID   = Common.Player_2Point;
                summary.rmiName = RmiName_Player_2Point;
                summary.hostID  = remote;
                summary.hostTag = hostTag;
                BeforeRmiInvocation(summary);
            }

            long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

            // Call this method.
            bool __ret = Player_2Point(remote, ctx, point, rotation, run);

            if (__ret == false)
            {
                // Error: RMI function that a user did not create has been called.
                core.ShowNotImplementedRmiWarning(RmiName_Player_2Point);
            }

            if (enableStubProfiling)
            {
                Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                summary.rmiID       = Common.Player_2Point;
                summary.rmiName     = RmiName_Player_2Point;
                summary.hostID      = remote;
                summary.hostTag     = hostTag;
                summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                AfterRmiInvocation(summary);
            }
        }
コード例 #3
0
        void ProcessReceivedMessage_RequestLogon(Nettention.Proud.Message __msg, Nettention.Proud.ReceivedMessage pa, Object hostTag, Nettention.Proud.HostID remote)
        {
            Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
            ctx.sentFrom     = pa.RemoteHostID;
            ctx.relayed      = pa.IsRelayed;
            ctx.hostTag      = hostTag;
            ctx.encryptMode  = pa.EncryptMode;
            ctx.compressMode = pa.CompressMode;

            String villeName; SngClient.Marshaler.Read(__msg, out villeName);
            String nickName; SngClient.Marshaler.Read(__msg, out nickName);
            bool   isNewVille; SngClient.Marshaler.Read(__msg, out isNewVille);

            core.PostCheckReadMessage(__msg, RmiName_RequestLogon);
            if (enableNotifyCallFromStub == true)
            {
                string parameterString = "";
                parameterString += villeName.ToString() + ",";
                parameterString += nickName.ToString() + ",";
                parameterString += isNewVille.ToString() + ",";
                NotifyCallFromStub(Common.RequestLogon, RmiName_RequestLogon, parameterString);
            }

            if (enableStubProfiling)
            {
                Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                summary.rmiID   = Common.RequestLogon;
                summary.rmiName = RmiName_RequestLogon;
                summary.hostID  = remote;
                summary.hostTag = hostTag;
                BeforeRmiInvocation(summary);
            }

            long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

            // Call this method.
            bool __ret = RequestLogon(remote, ctx, villeName, nickName, isNewVille);

            if (__ret == false)
            {
                // Error: RMI function that a user did not create has been called.
                core.ShowNotImplementedRmiWarning(RmiName_RequestLogon);
            }

            if (enableStubProfiling)
            {
                Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                summary.rmiID       = Common.RequestLogon;
                summary.rmiName     = RmiName_RequestLogon;
                summary.hostID      = remote;
                summary.hostTag     = hostTag;
                summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                AfterRmiInvocation(summary);
            }
        }
コード例 #4
0
        public override bool ProcessReceivedMessage(Nettention.Proud.ReceivedMessage pa, Object hostTag)
        {
            Nettention.Proud.HostID remote = pa.RemoteHostID;
            if (remote == Nettention.Proud.HostID.HostID_None)
            {
                ShowUnknownHostIDWarning(remote);
            }

            Nettention.Proud.Message __msg = pa.ReadOnlyMessage;
            int orgReadOffset = __msg.ReadOffset;

            Nettention.Proud.RmiID __rmiID = Nettention.Proud.RmiID.RmiID_None;
            if (!__msg.Read(out __rmiID))
            {
                goto __fail;
            }

            switch (__rmiID)
            {
            case Common.ReplyLogon:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                int clientID; CardClient.CardMarshaler.Read(__msg, out clientID);
                core.PostCheckReadMessage(__msg, RmiName_ReplyLogon);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += clientID.ToString() + ",";
                    NotifyCallFromStub(Common.ReplyLogon, RmiName_ReplyLogon, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.ReplyLogon;
                    summary.rmiName = RmiName_ReplyLogon;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = ReplyLogon(remote, ctx, clientID);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_ReplyLogon);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.ReplyLogon;
                    summary.rmiName     = RmiName_ReplyLogon;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.ReplyClientCount:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                int clientCount; CardClient.CardMarshaler.Read(__msg, out clientCount);
                core.PostCheckReadMessage(__msg, RmiName_ReplyClientCount);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += clientCount.ToString() + ",";
                    NotifyCallFromStub(Common.ReplyClientCount, RmiName_ReplyClientCount, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.ReplyClientCount;
                    summary.rmiName = RmiName_ReplyClientCount;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = ReplyClientCount(remote, ctx, clientCount);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_ReplyClientCount);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.ReplyClientCount;
                    summary.rmiName     = RmiName_ReplyClientCount;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.MachingComplete:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                core.PostCheckReadMessage(__msg, RmiName_MachingComplete);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    NotifyCallFromStub(Common.MachingComplete, RmiName_MachingComplete, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.MachingComplete;
                    summary.rmiName = RmiName_MachingComplete;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = MachingComplete(remote, ctx);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_MachingComplete);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.MachingComplete;
                    summary.rmiName     = RmiName_MachingComplete;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.SendCardData:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                CardData cardData; CardClient.CardMarshaler.Read(__msg, out cardData);
                core.PostCheckReadMessage(__msg, RmiName_SendCardData);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += cardData.ToString() + ",";
                    NotifyCallFromStub(Common.SendCardData, RmiName_SendCardData, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.SendCardData;
                    summary.rmiName = RmiName_SendCardData;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = SendCardData(remote, ctx, cardData);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_SendCardData);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.SendCardData;
                    summary.rmiName     = RmiName_SendCardData;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            default:
                goto __fail;
            }
            return(true);

__fail:
            {
                __msg.ReadOffset = orgReadOffset;
                return(false);
            }
        }
コード例 #5
0
        public override bool ProcessReceivedMessage(Nettention.Proud.ReceivedMessage pa, Object hostTag)
        {
            Nettention.Proud.HostID remote = pa.RemoteHostID;
            if (remote == Nettention.Proud.HostID.HostID_None)
            {
                ShowUnknownHostIDWarning(remote);
            }

            Nettention.Proud.Message __msg = pa.ReadOnlyMessage;
            int orgReadOffset = __msg.ReadOffset;

            Nettention.Proud.RmiID __rmiID = Nettention.Proud.RmiID.RmiID_None;
            if (!__msg.Read(out __rmiID))
            {
                goto __fail;
            }

            switch (__rmiID)
            {
            case Common.RequestLogon:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                String villeName; SngClient.Marshaler.Read(__msg, out villeName);
                bool   isNewVille; SngClient.Marshaler.Read(__msg, out isNewVille);
                core.PostCheckReadMessage(__msg, RmiName_RequestLogon);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += villeName.ToString() + ",";
                    parameterString += isNewVille.ToString() + ",";
                    NotifyCallFromStub(Common.RequestLogon, RmiName_RequestLogon, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.RequestLogon;
                    summary.rmiName = RmiName_RequestLogon;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = RequestLogon(remote, ctx, villeName, isNewVille);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_RequestLogon);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.RequestLogon;
                    summary.rmiName     = RmiName_RequestLogon;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.RequestAddTree:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                UnityEngine.Vector3 position; SngClient.Marshaler.Read(__msg, out position);
                core.PostCheckReadMessage(__msg, RmiName_RequestAddTree);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += position.ToString() + ",";
                    NotifyCallFromStub(Common.RequestAddTree, RmiName_RequestAddTree, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.RequestAddTree;
                    summary.rmiName = RmiName_RequestAddTree;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = RequestAddTree(remote, ctx, position);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_RequestAddTree);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.RequestAddTree;
                    summary.rmiName     = RmiName_RequestAddTree;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.RequestRemoveTree:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                int treeID; SngClient.Marshaler.Read(__msg, out treeID);
                core.PostCheckReadMessage(__msg, RmiName_RequestRemoveTree);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += treeID.ToString() + ",";
                    NotifyCallFromStub(Common.RequestRemoveTree, RmiName_RequestRemoveTree, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.RequestRemoveTree;
                    summary.rmiName = RmiName_RequestRemoveTree;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = RequestRemoveTree(remote, ctx, treeID);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_RequestRemoveTree);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.RequestRemoveTree;
                    summary.rmiName     = RmiName_RequestRemoveTree;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            default:
                goto __fail;
            }
            return(true);

__fail:
            {
                __msg.ReadOffset = orgReadOffset;
                return(false);
            }
        }
コード例 #6
0
        public override bool ProcessReceivedMessage(Nettention.Proud.ReceivedMessage pa, Object hostTag)
        {
            Nettention.Proud.HostID remote = pa.RemoteHostID;
            if (remote == Nettention.Proud.HostID.HostID_None)
            {
                ShowUnknownHostIDWarning(remote);
            }

            Nettention.Proud.Message __msg = pa.ReadOnlyMessage;
            int orgReadOffset = __msg.ReadOffset;

            Nettention.Proud.RmiID __rmiID = Nettention.Proud.RmiID.RmiID_None;
            if (!__msg.Read(out __rmiID))
            {
                goto __fail;
            }

            switch (__rmiID)
            {
            case Common.SettingOK:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                core.PostCheckReadMessage(__msg, RmiName_SettingOK);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    NotifyCallFromStub(Common.SettingOK, RmiName_SettingOK, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.SettingOK;
                    summary.rmiName = RmiName_SettingOK;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = SettingOK(remote, ctx);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_SettingOK);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.SettingOK;
                    summary.rmiName     = RmiName_SettingOK;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.CardInfo:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                CardInfo_send info; CardClient.Marshaler.Read(__msg, out info);
                core.PostCheckReadMessage(__msg, RmiName_CardInfo);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += info.ToString() + ",";
                    NotifyCallFromStub(Common.CardInfo, RmiName_CardInfo, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.CardInfo;
                    summary.rmiName = RmiName_CardInfo;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = CardInfo(remote, ctx, info);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_CardInfo);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.CardInfo;
                    summary.rmiName     = RmiName_CardInfo;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.ClearInfo:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                core.PostCheckReadMessage(__msg, RmiName_ClearInfo);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    NotifyCallFromStub(Common.ClearInfo, RmiName_ClearInfo, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.ClearInfo;
                    summary.rmiName = RmiName_ClearInfo;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = ClearInfo(remote, ctx);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_ClearInfo);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.ClearInfo;
                    summary.rmiName     = RmiName_ClearInfo;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.Init:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                int hostNum; CardClient.Marshaler.Read(__msg, out hostNum);
                core.PostCheckReadMessage(__msg, RmiName_Init);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += hostNum.ToString() + ",";
                    NotifyCallFromStub(Common.Init, RmiName_Init, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.Init;
                    summary.rmiName = RmiName_Init;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = Init(remote, ctx, hostNum);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_Init);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.Init;
                    summary.rmiName     = RmiName_Init;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.HandCardCount:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                int num; CardClient.Marshaler.Read(__msg, out num);
                core.PostCheckReadMessage(__msg, RmiName_HandCardCount);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += num.ToString() + ",";
                    NotifyCallFromStub(Common.HandCardCount, RmiName_HandCardCount, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.HandCardCount;
                    summary.rmiName = RmiName_HandCardCount;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = HandCardCount(remote, ctx, num);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_HandCardCount);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.HandCardCount;
                    summary.rmiName     = RmiName_HandCardCount;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.ReturnInfo:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                int fieldNum; CardClient.Marshaler.Read(__msg, out fieldNum);
                core.PostCheckReadMessage(__msg, RmiName_ReturnInfo);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += fieldNum.ToString() + ",";
                    NotifyCallFromStub(Common.ReturnInfo, RmiName_ReturnInfo, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.ReturnInfo;
                    summary.rmiName = RmiName_ReturnInfo;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = ReturnInfo(remote, ctx, fieldNum);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_ReturnInfo);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.ReturnInfo;
                    summary.rmiName     = RmiName_ReturnInfo;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.SummonInfo:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                CardInfo_send info; CardClient.Marshaler.Read(__msg, out info);
                core.PostCheckReadMessage(__msg, RmiName_SummonInfo);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += info.ToString() + ",";
                    NotifyCallFromStub(Common.SummonInfo, RmiName_SummonInfo, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.SummonInfo;
                    summary.rmiName = RmiName_SummonInfo;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = SummonInfo(remote, ctx, info);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_SummonInfo);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.SummonInfo;
                    summary.rmiName     = RmiName_SummonInfo;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.RandomInfo:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                bool ran1; CardClient.Marshaler.Read(__msg, out ran1);
                bool ran2; CardClient.Marshaler.Read(__msg, out ran2);
                bool ran3; CardClient.Marshaler.Read(__msg, out ran3);
                bool ran4; CardClient.Marshaler.Read(__msg, out ran4);
                bool ran5; CardClient.Marshaler.Read(__msg, out ran5);
                core.PostCheckReadMessage(__msg, RmiName_RandomInfo);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += ran1.ToString() + ",";
                    parameterString += ran2.ToString() + ",";
                    parameterString += ran3.ToString() + ",";
                    parameterString += ran4.ToString() + ",";
                    parameterString += ran5.ToString() + ",";
                    NotifyCallFromStub(Common.RandomInfo, RmiName_RandomInfo, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.RandomInfo;
                    summary.rmiName = RmiName_RandomInfo;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = RandomInfo(remote, ctx, ran1, ran2, ran3, ran4, ran5);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_RandomInfo);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.RandomInfo;
                    summary.rmiName     = RmiName_RandomInfo;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.InitInfo:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                int cardNum; CardClient.Marshaler.Read(__msg, out cardNum);
                core.PostCheckReadMessage(__msg, RmiName_InitInfo);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += cardNum.ToString() + ",";
                    NotifyCallFromStub(Common.InitInfo, RmiName_InitInfo, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.InitInfo;
                    summary.rmiName = RmiName_InitInfo;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = InitInfo(remote, ctx, cardNum);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_InitInfo);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.InitInfo;
                    summary.rmiName     = RmiName_InitInfo;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            default:
                goto __fail;
            }
            return(true);

__fail:
            {
                __msg.ReadOffset = orgReadOffset;
                return(false);
            }
        }
コード例 #7
0
        public override bool ProcessReceivedMessage(Nettention.Proud.ReceivedMessage pa, Object hostTag)
        {
            Nettention.Proud.HostID remote = pa.RemoteHostID;
            if (remote == Nettention.Proud.HostID.HostID_None)
            {
                ShowUnknownHostIDWarning(remote);
            }

            Nettention.Proud.Message __msg = pa.ReadOnlyMessage;
            int orgReadOffset = __msg.ReadOffset;

            Nettention.Proud.RmiID __rmiID = Nettention.Proud.RmiID.RmiID_None;
            if (!__msg.Read(out __rmiID))
            {
                goto __fail;
            }

            switch (__rmiID)
            {
            case Common.Snapshot:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                nan2.module.TeamModule.Snapshot snapshot; nan2.ProudMarshaler.Read(__msg, out snapshot);
                core.PostCheckReadMessage(__msg, RmiName_Snapshot);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += snapshot.ToString() + ",";
                    NotifyCallFromStub(Common.Snapshot, RmiName_Snapshot, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.Snapshot;
                    summary.rmiName = RmiName_Snapshot;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = Snapshot(remote, ctx, snapshot);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_Snapshot);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.Snapshot;
                    summary.rmiName     = RmiName_Snapshot;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.TeamJoined:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                Nettention.Proud.HostID player_id; nan2.ProudMarshaler.Read(__msg, out player_id);
                int team; nan2.ProudMarshaler.Read(__msg, out team);
                core.PostCheckReadMessage(__msg, RmiName_TeamJoined);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += player_id.ToString() + ",";
                    parameterString += team.ToString() + ",";
                    NotifyCallFromStub(Common.TeamJoined, RmiName_TeamJoined, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.TeamJoined;
                    summary.rmiName = RmiName_TeamJoined;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = TeamJoined(remote, ctx, player_id, team);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_TeamJoined);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.TeamJoined;
                    summary.rmiName     = RmiName_TeamJoined;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.TeamLeft:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                Nettention.Proud.HostID player_id; nan2.ProudMarshaler.Read(__msg, out player_id);
                int team; nan2.ProudMarshaler.Read(__msg, out team);
                core.PostCheckReadMessage(__msg, RmiName_TeamLeft);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += player_id.ToString() + ",";
                    parameterString += team.ToString() + ",";
                    NotifyCallFromStub(Common.TeamLeft, RmiName_TeamLeft, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.TeamLeft;
                    summary.rmiName = RmiName_TeamLeft;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = TeamLeft(remote, ctx, player_id, team);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_TeamLeft);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.TeamLeft;
                    summary.rmiName     = RmiName_TeamLeft;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.Scored:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                int team; nan2.ProudMarshaler.Read(__msg, out team);
                int score; nan2.ProudMarshaler.Read(__msg, out score);
                core.PostCheckReadMessage(__msg, RmiName_Scored);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += team.ToString() + ",";
                    parameterString += score.ToString() + ",";
                    NotifyCallFromStub(Common.Scored, RmiName_Scored, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.Scored;
                    summary.rmiName = RmiName_Scored;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = Scored(remote, ctx, team, score);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_Scored);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.Scored;
                    summary.rmiName     = RmiName_Scored;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            default:
                goto __fail;
            }
            return(true);

__fail:
            {
                __msg.ReadOffset = orgReadOffset;
                return(false);
            }
        }
コード例 #8
0
        public override bool ProcessReceivedMessage(Nettention.Proud.ReceivedMessage pa, Object hostTag)
        {
            Nettention.Proud.HostID remote = pa.RemoteHostID;
            if (remote == Nettention.Proud.HostID.HostID_None)
            {
                ShowUnknownHostIDWarning(remote);
            }

            Nettention.Proud.Message __msg = pa.ReadOnlyMessage;
            int orgReadOffset = __msg.ReadOffset;

            Nettention.Proud.RmiID __rmiID = Nettention.Proud.RmiID.RmiID_None;
            if (!__msg.Read(out __rmiID))
            {
                goto __fail;
            }

            switch (__rmiID)
            {
            case Common.PlayerSnapshots:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                nan2.LocalCharacterSnapshot local_character_snapshot; nan2.ProudMarshaler.Read(__msg, out local_character_snapshot);
                System.Collections.Generic.List <nan2.RemoteCharacterSnapshot> remote_character_snapshot; nan2.ProudMarshaler.Read(__msg, out remote_character_snapshot);
                core.PostCheckReadMessage(__msg, RmiName_PlayerSnapshots);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += local_character_snapshot.ToString() + ",";
                    parameterString += remote_character_snapshot.ToString() + ",";
                    NotifyCallFromStub(Common.PlayerSnapshots, RmiName_PlayerSnapshots, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.PlayerSnapshots;
                    summary.rmiName = RmiName_PlayerSnapshots;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = PlayerSnapshots(remote, ctx, local_character_snapshot, remote_character_snapshot);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_PlayerSnapshots);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.PlayerSnapshots;
                    summary.rmiName     = RmiName_PlayerSnapshots;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.JoinWorld:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                System.Collections.Generic.List <Nettention.Proud.HostID> player_ids; nan2.ProudMarshaler.Read(__msg, out player_ids);
                core.PostCheckReadMessage(__msg, RmiName_JoinWorld);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += player_ids.ToString() + ",";
                    NotifyCallFromStub(Common.JoinWorld, RmiName_JoinWorld, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.JoinWorld;
                    summary.rmiName = RmiName_JoinWorld;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = JoinWorld(remote, ctx, player_ids);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_JoinWorld);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.JoinWorld;
                    summary.rmiName     = RmiName_JoinWorld;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.PlayerJoin:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                Nettention.Proud.HostID player_id; nan2.ProudMarshaler.Read(__msg, out player_id);
                core.PostCheckReadMessage(__msg, RmiName_PlayerJoin);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += player_id.ToString() + ",";
                    NotifyCallFromStub(Common.PlayerJoin, RmiName_PlayerJoin, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.PlayerJoin;
                    summary.rmiName = RmiName_PlayerJoin;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = PlayerJoin(remote, ctx, player_id);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_PlayerJoin);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.PlayerJoin;
                    summary.rmiName     = RmiName_PlayerJoin;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.PlayerLeave:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                Nettention.Proud.HostID player_id; nan2.ProudMarshaler.Read(__msg, out player_id);
                core.PostCheckReadMessage(__msg, RmiName_PlayerLeave);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += player_id.ToString() + ",";
                    NotifyCallFromStub(Common.PlayerLeave, RmiName_PlayerLeave, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.PlayerLeave;
                    summary.rmiName = RmiName_PlayerLeave;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = PlayerLeave(remote, ctx, player_id);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_PlayerLeave);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.PlayerLeave;
                    summary.rmiName     = RmiName_PlayerLeave;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.SkillCasted:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                Nettention.Proud.HostID player_id; nan2.ProudMarshaler.Read(__msg, out player_id);
                nan2.SkillCastSnapshot  snapshot; nan2.ProudMarshaler.Read(__msg, out snapshot);
                core.PostCheckReadMessage(__msg, RmiName_SkillCasted);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += player_id.ToString() + ",";
                    parameterString += snapshot.ToString() + ",";
                    NotifyCallFromStub(Common.SkillCasted, RmiName_SkillCasted, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.SkillCasted;
                    summary.rmiName = RmiName_SkillCasted;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = SkillCasted(remote, ctx, player_id, snapshot);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_SkillCasted);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.SkillCasted;
                    summary.rmiName     = RmiName_SkillCasted;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.CharacterSpawned:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                Nettention.Proud.HostID player_id; nan2.ProudMarshaler.Read(__msg, out player_id);
                UnityEngine.Vector2     position; nan2.ProudMarshaler.Read(__msg, out position);
                core.PostCheckReadMessage(__msg, RmiName_CharacterSpawned);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += player_id.ToString() + ",";
                    parameterString += position.ToString() + ",";
                    NotifyCallFromStub(Common.CharacterSpawned, RmiName_CharacterSpawned, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.CharacterSpawned;
                    summary.rmiName = RmiName_CharacterSpawned;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = CharacterSpawned(remote, ctx, player_id, position);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_CharacterSpawned);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.CharacterSpawned;
                    summary.rmiName     = RmiName_CharacterSpawned;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            case Common.CharacterDied:
            {
                Nettention.Proud.RmiContext ctx = new Nettention.Proud.RmiContext();
                ctx.sentFrom     = pa.RemoteHostID;
                ctx.relayed      = pa.IsRelayed;
                ctx.hostTag      = hostTag;
                ctx.encryptMode  = pa.EncryptMode;
                ctx.compressMode = pa.CompressMode;

                Nettention.Proud.HostID player_id; nan2.ProudMarshaler.Read(__msg, out player_id);
                core.PostCheckReadMessage(__msg, RmiName_CharacterDied);
                if (enableNotifyCallFromStub == true)
                {
                    string parameterString = "";
                    parameterString += player_id.ToString() + ",";
                    NotifyCallFromStub(Common.CharacterDied, RmiName_CharacterDied, parameterString);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.BeforeRmiSummary summary = new Nettention.Proud.BeforeRmiSummary();
                    summary.rmiID   = Common.CharacterDied;
                    summary.rmiName = RmiName_CharacterDied;
                    summary.hostID  = remote;
                    summary.hostTag = hostTag;
                    BeforeRmiInvocation(summary);
                }

                long t0 = Nettention.Proud.PreciseCurrentTime.GetTimeMs();

                // Call this method.
                bool __ret = CharacterDied(remote, ctx, player_id);

                if (__ret == false)
                {
                    // Error: RMI function that a user did not create has been called.
                    core.ShowNotImplementedRmiWarning(RmiName_CharacterDied);
                }

                if (enableStubProfiling)
                {
                    Nettention.Proud.AfterRmiSummary summary = new Nettention.Proud.AfterRmiSummary();
                    summary.rmiID       = Common.CharacterDied;
                    summary.rmiName     = RmiName_CharacterDied;
                    summary.hostID      = remote;
                    summary.hostTag     = hostTag;
                    summary.elapsedTime = Nettention.Proud.PreciseCurrentTime.GetTimeMs() - t0;
                    AfterRmiInvocation(summary);
                }
            }
            break;

            default:
                goto __fail;
            }
            return(true);

__fail:
            {
                __msg.ReadOffset = orgReadOffset;
                return(false);
            }
        }