Exemplo n.º 1
0
    static int AddTransmitter(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 3);
        INetManager obj  = LuaScriptMgr.GetNetObject <INetManager>(L, 1);
        string      arg0 = LuaScriptMgr.GetLuaString(L, 2);

        com.gt.mpnet.MessageTransmitter arg1 = LuaScriptMgr.GetNetObject <com.gt.mpnet.MessageTransmitter>(L, 3);
        obj.AddTransmitter(arg0, arg1);
        return(0);
    }
Exemplo n.º 2
0
    static int GetTransmitter(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        INetManager obj  = LuaScriptMgr.GetNetObject <INetManager>(L, 1);
        string      arg0 = LuaScriptMgr.GetLuaString(L, 2);

        com.gt.mpnet.MessageTransmitter o = obj.GetTransmitter(arg0);
        LuaScriptMgr.PushObject(L, o);
        return(1);
    }
Exemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="key"></param>
 /// <param name="transmitter"></param>
 public void AddTransmitter(string key, MessageTransmitter transmitter)
 {
     if (transmitter == null)
     {
         throw new ArgumentException("Transmitter is null, it can't be added.");
     }
     if (transmitters.ContainsKey(key))
     {
         throw new ArgumentException(string.Concat("A transmitter with type: ", transmitter.GetType(), " already exists! Transmitter can't be added: ", transmitter));
     }
     transmitters.Add(key, transmitter);
 }