protected override void SendRequestOrObservation(string destCh, ApianMessage msg)
 {
     if ((msg.MsgType == ApianMessage.CliObservation) &&
         (ApianGroup?.GroupCreatorId != GameNet.LocalP2pId()))
     {
         Logger.Debug($"SendRequestOrObservation() We are not server, so don't send observations.");
         return;
     }
     base.SendRequestOrObservation(destCh, msg); // let this filter it too
 }
Example #2
0
    public void Recieve()
    {
        mSocket.Receive(mReceiveData);

        var msg = GameNet.Deserialize <Msg>(mReceiveData);

        if (null != msg)
        {
        }
    }
Example #3
0
        public InnerMeetingHud(ILogger <InnerMeetingHud> logger, IEventManager eventManager, Game game)
        {
            _logger       = logger;
            _eventManager = eventManager;
            _game         = game;
            _gameNet      = game.GameNet;
            _playerStates = null;

            Components.Add(this);
        }
Example #4
0
        static int _s_set_OnReConnect(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                GameNet gen_to_be_invoked = (GameNet)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.OnReConnect = translator.GetDelegate <UnityEngine.Events.UnityAction>(L, 2);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(0);
        }
Example #5
0
        static int _s_set_m_socket(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                GameNet gen_to_be_invoked = (GameNet)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.m_socket = (System.Net.Sockets.Socket)translator.GetObject(L, 2, typeof(System.Net.Sockets.Socket));
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(0);
        }
Example #6
0
        static int _g_get_OnReConnect(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                GameNet gen_to_be_invoked = (GameNet)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.OnReConnect);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Example #7
0
    public GameNet()
    {
        IPAddress ipAddress = IPAddress.Parse("192.168.95.143");
        int       port      = 5050;

        Connect(ipAddress, port);
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Debug.LogError("Try To Instance [GameNet] Twice!");
        }
    }
Example #8
0
    private void OnLoginResponse(byte[] data)
    {
        var msg = GameNet.Deserialize <Msg>(data);

        if (null != msg.response)
        {
            if (!GameNet.Main.ResponseError(msg.response.loginResponse.nErrorCode))
            {
                DebugUtils.Log("UserId:" + msg.response.loginResponse.requester.nUserID);
                PlayerManager.Instance.SetUserInfo(msg.response.loginResponse.requester);
            }
        }
        else
        {
            DebugUtils.LogWarning("OnLoginResponse msg is null!");
        }
    }
Example #9
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    GameNet gen_ret = new GameNet();
                    translator.Push(L, gen_ret);

                    return(1);
                }
            }
            catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to GameNet constructor!"));
        }
Example #10
0
        static int _m_Release(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                GameNet gen_to_be_invoked = (GameNet)translator.FastGetCSObj(L, 1);



                {
                    gen_to_be_invoked.Release(  );



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Example #11
0
        static int _m_OnStatusChanged(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                GameNet gen_to_be_invoked = (GameNet)translator.FastGetCSObj(L, 1);



                {
                    ExitGames.Client.Photon.StatusCode _statusCode; translator.Get(L, 2, out _statusCode);

                    gen_to_be_invoked.OnStatusChanged(_statusCode);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Example #12
0
        static int _m_SetOnDisconnectCallBack(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                GameNet gen_to_be_invoked = (GameNet)translator.FastGetCSObj(L, 1);



                {
                    UnityEngine.Events.UnityAction _call = translator.GetDelegate <UnityEngine.Events.UnityAction>(L, 2);

                    gen_to_be_invoked.SetOnDisconnectCallBack(_call);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Example #13
0
        static int _m_OnOperationResponse(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                GameNet gen_to_be_invoked = (GameNet)translator.FastGetCSObj(L, 1);



                {
                    ExitGames.Client.Photon.OperationResponse _operationResponse = (ExitGames.Client.Photon.OperationResponse)translator.GetObject(L, 2, typeof(ExitGames.Client.Photon.OperationResponse));

                    gen_to_be_invoked.OnOperationResponse(_operationResponse);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Example #14
0
        static int _m_UnRegisterProtocol(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                GameNet gen_to_be_invoked = (GameNet)translator.FastGetCSObj(L, 1);



                {
                    byte _opCode = (byte)LuaAPI.xlua_tointeger(L, 2);

                    gen_to_be_invoked.UnRegisterProtocol(_opCode);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Example #15
0
        static int _m_RegisterProtocol(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                GameNet gen_to_be_invoked = (GameNet)translator.FastGetCSObj(L, 1);



                {
                    ProtocolBase _protocol = (ProtocolBase)translator.GetObject(L, 2, typeof(ProtocolBase));

                    gen_to_be_invoked.RegisterProtocol(_protocol);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Example #16
0
        static int _m_DebugReturn(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                GameNet gen_to_be_invoked = (GameNet)translator.FastGetCSObj(L, 1);



                {
                    ExitGames.Client.Photon.DebugLevel _level; translator.Get(L, 2, out _level);
                    string _message = LuaAPI.lua_tostring(L, 3);

                    gen_to_be_invoked.DebugReturn(_level, _message);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Example #17
0
 public GameMsgNetAgentHandler(GameNet game_net)
 {
     m_gameNet = game_net;
 }
Example #18
0
 protected override void Awake()
 {
     GameNet net = new GameNet();
 }