Skip to content

Commit 45f5e2f

Browse files
committed
Merge branch 'normal'
Conflicts: root.py
2 parents 73e3d59 + 4a62832 commit 45f5e2f

File tree

6 files changed

+2056
-1398
lines changed

6 files changed

+2056
-1398
lines changed

__init__.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99
import memcache
1010
import time
1111
import json
12+
import MySQLdb
1213
# Global session manager: DBSession() returns the Thread-local
1314
# session object appropriate for the current web request.
15+
con = MySQLdb.connect(host='localhost', passwd='2e4n5k2w2x', user='root', db='stcHong')
16+
cursor = con.cursor()
1417
maker = sessionmaker(autoflush=True, autocommit=False,
1518
extension=ZopeTransactionExtension())
1619
DBSession = scoped_session(maker)
@@ -19,11 +22,12 @@
1922
timestr=str(time.strftime('%Y-%m-%d-%H:%M:%S',time.localtime(time.time())))
2023
taskbonus=[]
2124
wartaskbonus=[]
22-
f = file('taskbonus.json')
25+
f = file('/root/tg2env/taskbonus.json')
2326
source = f.read()
2427
target = json.JSONDecoder().decode(source)
25-
f2=file('wartask.json')
28+
f2=file('/root/tg2env/wartask.json')
2629
source2=f2.read()
30+
logfile = file("log.txt", "w")
2731
if source2!=None:
2832
target2 = json.JSONDecoder().decode(source2)
2933
for t in target:
@@ -35,7 +39,6 @@
3539
#newtask = newtask.read()
3640
#newtask = json.loads(newtask)
3741

38-
logfile=open("logfile"+timestr,'w')
3942
# Base class for all of our model classes: By default, the data model is
4043
# defined with SQLAlchemy's declarative extension, but if you need more
4144
# control, you can switch to the traditional method.
@@ -152,4 +155,6 @@ def init_model(engine):
152155
from stchong.model.dragon import Dragon
153156
from stchong.model.petAtt import PetAtt
154157
from stchong.model.message import Message
158+
from stchong.model.emptyCastal import EmptyCastal
159+
from stchong.model.emptyResult import EmptyResult
155160
#from stchong.model.useraccount import userAccount

clearPet.py

-45
This file was deleted.

emptyCastal.py

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from sqlalchemy import *
2+
from sqlalchemy.orm import mapper, relation
3+
from sqlalchemy import Table, ForeignKey, Column
4+
from sqlalchemy.types import Integer, Unicode
5+
from sqlalchemy.orm import relation, backref
6+
from stchong.model import DeclarativeBase, metadata, DBSession
7+
8+
class EmptyCastal(DeclarativeBase):
9+
__tablename__ = 'emptyCastal'
10+
#{ Columns uid and pid can pet move from one to others ? if so pid should be independent from user
11+
cid = Column(Integer, primary_key=True)#castal id
12+
uid = Column(Integer)#owner -1 empty
13+
mid = Column(Integer)#map
14+
gid = Column(Integer)#position
15+
inf = Column(Integer)
16+
cav = Column(Integer)
17+
attribute = Column(Integer)
18+
lastTime = Column(Integer)
19+

emptyResult.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from sqlalchemy import *
2+
from sqlalchemy.orm import mapper, relation
3+
from sqlalchemy import Table, ForeignKey, Column
4+
from sqlalchemy.types import Integer, Unicode
5+
from sqlalchemy.orm import relation, backref
6+
from stchong.model import DeclarativeBase, metadata, DBSession
7+
8+
class EmptyResult(DeclarativeBase):
9+
__tablename__ = 'emptyResult'
10+
#{ Columns uid and pid can pet move from one to others ? if so pid should be independent from user
11+
eid = Column(Integer, primary_key=True)#castal id
12+
uid = Column(Integer)#owner -1 empty
13+
data = Column(String)

nginx.conf

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
2+
user root root;
3+
worker_processes 1;
4+
5+
error_log logs/error.log;
6+
#error_log logs/error.log notice;
7+
#error_log logs/error.log info;
8+
9+
pid logs/nginx.pid;
10+
11+
12+
events {
13+
worker_connections 1024;
14+
}
15+
16+
17+
http {
18+
include mime.types;
19+
default_type application/octet-stream;
20+
21+
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
22+
# '$status $body_bytes_sent "$http_referer" '
23+
# '"$http_user_agent" "$http_x_forwarded_for"';
24+
25+
#access_log logs/access.log main;
26+
27+
sendfile on;
28+
#tcp_nopush on;
29+
30+
#keepalive_timeout 0;
31+
keepalive_timeout 65;
32+
33+
#gzip on;
34+
upstream tg_server{
35+
server 223.4.85.114:8080 weight=1;
36+
server 223.4.85.114:8088 weight=1;
37+
}
38+
upstream battle{
39+
server 0.0.0.0:8002;
40+
}
41+
server {
42+
listen 8000;
43+
server_name localhost;
44+
45+
#charset koi8-r;
46+
47+
#access_log logs/host.access.log main;
48+
49+
location / {
50+
root html;
51+
index index.html index.htm;
52+
proxy_pass http://tg_server;
53+
}
54+
location ~ /war {
55+
proxy_pass http://battle;
56+
}
57+
#error_page 404 /404.html;
58+
59+
# redirect server error pages to the static page /50x.html
60+
#
61+
error_page 500 502 503 504 /50x.html;
62+
location = /50x.html {
63+
root html;
64+
}
65+
66+
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
67+
#
68+
#location ~ \.php$ {
69+
# proxy_pass http://127.0.0.1;
70+
#}
71+
72+
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
73+
#
74+
#location ~ \.php$ {
75+
# root html;
76+
# fastcgi_pass 127.0.0.1:9000;
77+
# fastcgi_index index.php;
78+
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
79+
# include fastcgi_params;
80+
#}
81+
82+
# deny access to .htaccess files, if Apache's document root
83+
# concurs with nginx's one
84+
#
85+
#location ~ /\.ht {
86+
# deny all;
87+
#}
88+
}
89+
90+
91+
# another virtual host using mix of IP-, name-, and port-based configuration
92+
#
93+
#server {
94+
# listen 8000;
95+
# listen somename:8080;
96+
# server_name somename alias another.alias;
97+
98+
# location / {
99+
# root html;
100+
# index index.html index.htm;
101+
# }
102+
#}
103+
104+
105+
# HTTPS server
106+
#
107+
#server {
108+
# listen 443;
109+
# server_name localhost;
110+
111+
# ssl on;
112+
# ssl_certificate cert.pem;
113+
# ssl_certificate_key cert.key;
114+
115+
# ssl_session_timeout 5m;
116+
117+
# ssl_protocols SSLv2 SSLv3 TLSv1;
118+
# ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
119+
# ssl_prefer_server_ciphers on;
120+
121+
# location / {
122+
# root html;
123+
# index index.html index.htm;
124+
# }
125+
#}
126+
127+
}

0 commit comments

Comments
 (0)