Example #1
0
        private static int FriendSort(FriendInfo a, FriendInfo b)
        {
            int aGetReward = a.isGetPveAction ? 1 : 5;
            int bGetReward = b.isGetPveAction ? 1 : 5;

            if (aGetReward != bGetReward)
            {
                return(bGetReward - aGetReward);
            }

            int aDonate = a.isDonate ? 1 : 5;
            int bDonate = b.isDonate ? 1 : 5;

            if (aDonate != bDonate)
            {
                return(bDonate - aDonate);
            }
            if (a.level != b.level)
            {
                return(b.level - a.level);
            }
            if (b.power != a.power)
            {
                return(b.power - a.power);
            }

            return((int)(b.lastLoginTime - a.lastLoginTime));
        }
Example #2
0
    static int _CreateLogic_UI_Friend_Model_FriendInfo(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                Logic.UI.Friend.Model.FriendInfo obj = new Logic.UI.Friend.Model.FriendInfo();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else if (count == 1 && TypeChecker.CheckTypes(L, typeof(Logic.Protocol.Model.FriendProtoData)))
            {
                Logic.Protocol.Model.FriendProtoData arg0 = (Logic.Protocol.Model.FriendProtoData)ToLua.CheckObject(L, 1, typeof(Logic.Protocol.Model.FriendProtoData));
                Logic.UI.Friend.Model.FriendInfo     obj  = new Logic.UI.Friend.Model.FriendInfo(arg0);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: Logic.UI.Friend.Model.FriendInfo.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Example #3
0
 static int UpdateTeam(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         Logic.UI.Friend.Model.FriendInfo         obj  = (Logic.UI.Friend.Model.FriendInfo)ToLua.CheckObject(L, 1, typeof(Logic.UI.Friend.Model.FriendInfo));
         Logic.Protocol.Model.TeamDetailProtoData arg0 = (Logic.Protocol.Model.TeamDetailProtoData)ToLua.CheckObject(L, 2, typeof(Logic.Protocol.Model.TeamDetailProtoData));
         obj.UpdateTeam(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #4
0
 public void AddFriend(int funcId, FriendInfo info)
 {
     if (!_FriendDic.ContainsKey(funcId))
     {
         return;
     }
     if (info == null)
     {
         return;
     }
     if (_FriendDic[funcId].ContainsKey(info.id))
     {
         return;
     }
     _FriendDic[funcId].Add(info.id, info);
     FriendModelLua.GetLuaFunction("AddFriendFromCSharp").Call(funcId, info);
 }
Example #5
0
    static int set_vip(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.UI.Friend.Model.FriendInfo obj = (Logic.UI.Friend.Model.FriendInfo)o;
            int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.vip = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index vip on a nil value" : e.Message));
        }
    }
Example #6
0
    static int set_formationHeroList(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.UI.Friend.Model.FriendInfo obj = (Logic.UI.Friend.Model.FriendInfo)o;
            System.Collections.Generic.List <Logic.Role.Model.RoleInfo> arg0 = (System.Collections.Generic.List <Logic.Role.Model.RoleInfo>)ToLua.CheckObject(L, 2, typeof(System.Collections.Generic.List <Logic.Role.Model.RoleInfo>));
            obj.formationHeroList = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index formationHeroList on a nil value" : e.Message));
        }
    }
Example #7
0
    static int set_headIcon(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.UI.Friend.Model.FriendInfo obj = (Logic.UI.Friend.Model.FriendInfo)o;
            string arg0 = ToLua.CheckString(L, 2);
            obj.headIcon = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index headIcon on a nil value" : e.Message));
        }
    }
Example #8
0
    static int set_isBothAuth(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.UI.Friend.Model.FriendInfo obj = (Logic.UI.Friend.Model.FriendInfo)o;
            bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.isBothAuth = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index isBothAuth on a nil value" : e.Message));
        }
    }
Example #9
0
    static int get_vip(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.UI.Friend.Model.FriendInfo obj = (Logic.UI.Friend.Model.FriendInfo)o;
            int ret = obj.vip;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index vip on a nil value" : e.Message));
        }
    }
Example #10
0
    static int get_formationHeroList(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.UI.Friend.Model.FriendInfo obj = (Logic.UI.Friend.Model.FriendInfo)o;
            System.Collections.Generic.List <Logic.Role.Model.RoleInfo> ret = obj.formationHeroList;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index formationHeroList on a nil value" : e.Message));
        }
    }
Example #11
0
    static int get_headIcon(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.UI.Friend.Model.FriendInfo obj = (Logic.UI.Friend.Model.FriendInfo)o;
            string ret = obj.headIcon;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index headIcon on a nil value" : e.Message));
        }
    }
Example #12
0
    static int get_isBothAuth(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.UI.Friend.Model.FriendInfo obj = (Logic.UI.Friend.Model.FriendInfo)o;
            bool ret = obj.isBothAuth;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index isBothAuth on a nil value" : e.Message));
        }
    }
Example #13
0
    static int get_lastLoginTime(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Logic.UI.Friend.Model.FriendInfo obj = (Logic.UI.Friend.Model.FriendInfo)o;
            long ret = obj.lastLoginTime;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index lastLoginTime on a nil value" : e.Message));
        }
    }
Example #14
0
        public void AddFriend(int funcId, FriendProtoData data)
        {
            if (!_FriendDic.ContainsKey(funcId))
            {
                return;
            }
            if (data == null)
            {
                return;
            }
            if (_FriendDic[funcId].ContainsKey(data.id))
            {
                return;
            }
            FriendInfo info = new FriendInfo(data);

            _FriendDic[funcId].Add(data.id, info);
            FriendModelLua.GetLuaFunction("AddFriendFromCSharp").Call(funcId, info);
        }