예제 #1
0
파일: MmoPeer.cs 프로젝트: geosohal/Mmo
 public MmoPeer(InitRequest initRequest)
     : base(initRequest)
 {
     this.initialOpHandler = new MmoInitialOperationHandler(this);
     // this is the operation handler before entering a world
     this.SetInitialOperationhandler();
 }
예제 #2
0
 public MmoPeer(InitRequest initRequest)
     : base(initRequest)
 {
     this.initialOpHandler = new MmoInitialOperationHandler(this);
     // this is the operation handler before entering a world
     this.SetInitialOperationhandler();
 }
        public OperationResponse OnOperationRequest(PeerBase peer, OperationRequest operationRequest, SendParameters sendParameters)
        {
            switch ((OperationCode)operationRequest.OperationCode)
            {
            case OperationCode.AddInterestArea:
                return(this.OperationAddInterestArea(peer, operationRequest, sendParameters));

            case OperationCode.AttachInterestArea:
                return(this.OperationAttachInterestArea(peer, operationRequest, sendParameters));

            case OperationCode.DestroyItem:
                return(this.OperationDestroyItem(peer, operationRequest, sendParameters));

            case OperationCode.DetachInterestArea:
                return(this.OperationDetachInterestArea(peer, operationRequest));

            case OperationCode.ExitWorld:
                return(this.OperationExitWorld(peer, operationRequest));

            case OperationCode.GetProperties:
                return(this.OperationGetProperties(peer, operationRequest, sendParameters));

            case OperationCode.Move:
                return(this.OperationMove(peer, operationRequest, sendParameters));

            case OperationCode.MoveInterestArea:
                return(this.OperationMoveInterestArea(peer, operationRequest));

            case OperationCode.RemoveInterestArea:
                return(this.OperationRemoveInterestArea(peer, operationRequest));

            case OperationCode.SetProperties:
                return(this.OperationSetProperties(peer, operationRequest, sendParameters));

            case OperationCode.SetViewDistance:
                return(this.OperationSetViewDistance(peer, operationRequest));

            case OperationCode.SpawnItem:
                return(this.OperationSpawnItem(peer, operationRequest));

            case OperationCode.SubscribeItem:
                return(this.OperationSubscribeItem(peer, operationRequest, sendParameters));

            case OperationCode.UnsubscribeItem:
                return(this.OperationUnsubscribeItem(peer, operationRequest, sendParameters));

            case OperationCode.RadarSubscribe:
                return(MmoInitialOperationHandler.OperationRadarSubscribe(peer, operationRequest, sendParameters));

            case OperationCode.SubscribeCounter:
                return(CounterOperations.SubscribeCounter(peer, operationRequest));

            case OperationCode.UnsubscribeCounter:
                return(CounterOperations.SubscribeCounter(peer, operationRequest));

            case OperationCode.RaiseGenericEvent:
                return(this.OperationRaiseGenericEvent(peer, operationRequest, sendParameters));

            case OperationCode.CreateWorld:
            case OperationCode.EnterWorld:
                return(InvalidOperation(operationRequest));
            }

            return(new OperationResponse(operationRequest.OperationCode)
            {
                ReturnCode = (int)ReturnCode.OperationNotSupported,
                DebugMessage = "OperationNotSupported: " + operationRequest.OperationCode
            });
        }