Пример #1
0
            public static void Init()
            {
                SqliteDatabase sqliteDB = new SqliteDatabase("slidergame.db");

                sqliteDB.CreateTable("player_table", new string[] { "username", "passwords" }, new[] { "text", "text" });
                sqliteDB.Disconnect();
            } // end SqliteManager
Пример #2
0
            } // end CheckLogin

            /// <summary>
            /// 注册用户
            /// </summary>
            /// <param name="username"> 用户名 </param>
            /// <param name="passwords"> 密码 </param>
            /// <returns> 是否注册成功 </returns>
            public static bool RegisterPlayer(string username, string passwords)
            {
                if (true == CheckUserName(username))
                {
                    return(false);
                }
                // end if
                SqliteDatabase sqliteDB = new SqliteDatabase("slidergame.db");

                sqliteDB.Insert("player_table", new string[] { ToValue(username), ToValue(passwords) });
                sqliteDB.CreateTable("role_list_table_" + username, new string[] { "roleindex", "name", "roletype", "coin" },
                                     new string[] { "int", "text", "text", "int" });
                sqliteDB.CreateTable("role_equip_table_" + username, new string[] { "roleindex",
                                                                                    ConstConfig.WEAPON, ConstConfig.NECKLACE, ConstConfig.RING, ConstConfig.WING, ConstConfig.ARMOR, ConstConfig.PANTS, ConstConfig.SHOES },
                                     new string[] { "int", "text", "text", "text", "text", "text", "text", "text" });
                sqliteDB.CreateTable("pack_list_table_" + username, new string[] { "roleindex", "gid", "id", "type", "grade", "count" },
                                     new string[] { "int", "int", "text", "text", "text", "int" });
                sqliteDB.Disconnect();
                return(true);
            } // end RegisterPanel