- 001
- 002
- 003
- 004
- 005
- 006
- 007
- 008
- 009
- 010
- 011
- 012
- 013
- 014
- 015
- 016
- 017
- 018
- 019
- 020
- 021
- 022
- 023
- 024
- 025
- 026
- 027
- 028
- 029
- 030
- 031
- 032
- 033
- 034
- 035
- 036
- 037
- 038
- 039
- 040
- 041
- 042
- 043
- 044
- 045
- 046
- 047
- 048
- 049
- 050
- 051
- 052
- 053
- 054
- 055
- 056
- 057
- 058
- 059
- 060
- 061
- 062
- 063
- 064
- 065
- 066
- 067
- 068
- 069
- 070
- 071
- 072
- 073
- 074
- 075
- 076
- 077
- 078
- 079
- 080
- 081
- 082
- 083
- 084
- 085
- 086
- 087
- 088
- 089
- 090
- 091
- 092
- 093
- 094
- 095
- 096
- 097
- 098
- 099
- 100
procedure TWorker.handleAdminClient(socket: TTCPBlockSocket; json: ISuperObject);
var
msg: ansistring;
request: SOString;
//s: ISuperObject;
res: ISuperObject;
begin
res := json['data'];
msg := json['func'].AsString;
if msg = 'deletemarket' then
begin
database.deleteMarket(res.GetS('id'));
msg:='getmarkets';
end;
if msg = 'addmarket' then
begin
database.addMarket(res.GetS('mapid'),res.GetS('name'),res.GetS('type_id'));
msg:='getmarkets';
end;
if msg = 'setmarketitems' then
begin
database.setMarktItems(res.GetS('id'),res.GetA('items'));
TSocketSender.sendStr(socket, '{"type":"' + msg + '","data":{"id":' + res.GetS('id') + '}}');
exit;
end;
if msg = 'updatemarket' then
begin
database.updateMarkt(res.GetS('id'),res.GetS('name'),res.GetS('enabled'));
TSocketSender.sendStr(socket, '{"type":"' + msg + '","data":{"id":' + res.GetS('id') + '}}');
exit;
end;
if msg = 'getmarktitems' then
begin
request := database.getMarktItems(res.GetS('id'));
TSocketSender.sendStr(socket, '{ "type" : "' + msg + '" , "data" : ' + request + '}');
exit;
end;
if msg = 'getmarkets' then
begin
request := database.getMarkets();
TSocketSender.sendStr(socket, '{ "type" : "' + msg + '" , "data" : ' + request + '}');
exit;
end;
if msg = 'getmarkettypes' then
begin
request := database.getMarketTypes();
TSocketSender.sendStr(socket, '{ "type" : "' + msg + '" , "data" : ' + request + '}');
exit;
end;
if msg = 'getitems' then
begin
request := database.getAdminItems();
TSocketSender.sendStr(socket, '{ "type" : "' + msg + '" , "data" : ' + request + '}');
exit;
end;
if msg = 'getitemstypes' then
begin
request := database.getAdminItemsTypes();
TSocketSender.sendStr(socket, '{ "type" : "' + msg + '" , "data" : ' + request + '}');
exit;
end;
if msg = 'getitem' then
begin
request := database.getItem(res['itemid'].AsInteger).getJSON.AsString;
TSocketSender.sendStr(socket, '{ "type" : "' + msg + '" , "data" : ' + request + '}');
exit;
end;
if msg = 'additem' then
begin
request := database.addItem(res);
TSocketSender.sendStr(socket, '{ "type" : "' + msg + '" , "data" : ' + request + '}');
exit;
end;
if msg = 'setitem' then
begin
database.setItem(res);
exit;
end;
if msg = 'getavatar' then
begin
getAvatar(socket);
exit;
end;
if msg = 'acceptavatar' then
begin
acceptAvatar(res);
exit;
end;
if msg = 'declineavatar' then
begin
declineAvatar(res);
exit;
end;
if msg = 'admindata' then
begin
sendAdminData(socket);
exit;
jojaxon 04.07.2020 18:20 # 0
guest6 02.11.2020 22:34 # 0
MAPTbIwKA 02.11.2020 22:35 # 0
guest6 02.11.2020 22:36 # 0
Saehrimnir 03.11.2020 01:16 # +1
CBuHOKYP 04.10.2021 00:39 # 0
betking1 19.07.2021 12:39 # 0