-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMapleStoryServer.py
59 lines (45 loc) · 1.64 KB
/
MapleStoryServer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import sys
import os
import asyncio
from Config.MapleStoryConfig import *
from MySQLdb.MapleStroyDB import *
from Socket.SocketLogin import SocketLogin
from Socket.SocketChannel import SocketChannel
async def socket_wait():
socket_login = SocketLogin("127.0.0.1", 8484, 10)
socket_login.m_server = await asyncio.start_server(socket_login._socket_callback
, socket_login.m_ip
, socket_login.m_port)
socket_channel = SocketChannel("127.0.0.1", 7575, 30)
socket_channel.m_server = await asyncio.start_server(socket_channel._socket_callback
, socket_channel.m_ip
, socket_channel.m_port)
async with socket_login.m_server, socket_channel.m_server:
await asyncio.gather(
socket_login.m_server.serve_forever()
, socket_channel.m_server.serve_forever())
pass
def main(argc, argv):
maplestory_config = MapleStoryConfig(os.getcwd() + '/Resources/config/')
maplestroy_db = MapleStroyDB(
maplestory_config.m_database.m_dbUrl
, maplestory_config.m_database.m_dbUser
, maplestory_config.m_database.m_dbPass
, os.getcwd() + '/Resources/sql/')
#iret = 0
#while True:
# iret = maplestroy_db.init(maplestory_config.m_game)
# if iret :
# break
#break
asyncio.run(socket_wait())
while True:
time.sleep(1000)
pass
return 0
# debian apt -y install python3-pycryptodome
# windows pip install pycryptodome
# pip install mysql-connector-python
# pip install PyYaml
if __name__ == "__main__":
main(len(sys.argv), sys.argv)