Example #1
0
    private void push_data(Sio.SDataBuff data, IntPtr L, NParam o)
    {
        switch (data.type)
        {
        case SType.stype_bool:
            LuaAPI.lua_pushboolean(L, data.boolValue);
            break;

        case SType.stype_uchar:
            LuaAPI.xlua_pushuint(L, data.ucharValue);
            break;

        case SType.stype_char:
            LuaAPI.xlua_pushinteger(L, data.charValue);
            break;

        case SType.stype_short:
            LuaAPI.xlua_pushinteger(L, data.shortValue);
            break;

        case SType.stype_ushort:
            LuaAPI.xlua_pushuint(L, data.ushortValue);
            break;

        case SType.stype_int:
            LuaAPI.xlua_pushinteger(L, data.intValue);
            break;

        case SType.stype_uint:
            LuaAPI.xlua_pushuint(L, data.uintValue);
            break;

        case SType.stype_float:
            LuaAPI.lua_pushnumber(L, data.floatValue);
            break;

        case SType.stype_double:
            LuaAPI.lua_pushnumber(L, data.doubleValue);
            break;

        case SType.stype_long:
            LuaAPI.lua_pushint64(L, data.longValue);
            break;

        case SType.stype_string:
            LuaAPI.lua_pushstring(L, data.stringValue);
            break;

        case SType.stype_list:
            push_list(data, o, L);
            break;

        case SType.stype_map:
            push_map(data, o, L);
            break;

        default:
            Logger.LogError("push_data error!!!!!!!!!!!!!!! type:" + data.type.ToString());
            break;
        }
    }