Куча мелких фиксов, уборка мусора.

This commit is contained in:
lopar 2020-09-30 01:39:06 +03:00
parent 640e85cf18
commit 5ac30becb7
149 changed files with 4221 additions and 11012 deletions

8
.gitignore vendored
View File

@ -1 +1,7 @@
.idea/
.idea/
.unused/
logs/battle*/*.txt
tmp/*.btl
tmp/*.txt
README.md
Thumbs.db

View File

@ -1,10 +0,0 @@
# README #
Проект БК1\БК2 времён до появления приёмов.
Версионности не будет, пока проект не станет стабильным на PHP5.6.
### What is this repository for? ###
* Quick summary
* Version
* [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo)

View File

@ -1,284 +0,0 @@
function H(isOutBox){
this.document = document;
this.isOutBox = isOutBox;
this.iframe = this.isOutBox ? $('#mainbox') : $('body');
// DOM-элемент, который перехватывает клик по логину
//this.grabLogin = null;
// DOM-элемент, который перехватывает клик по названию шмотки
//this.grabItem = null;
this.grabLogin = new Grabber({inputClass: 'grabLogin'});
this.grabItem = new Grabber({inputClass: 'grabLogin'});
// storage
this.data = {};
}
H.prototype.toString = function(){
return 'This is H-object';
}
H.prototype.getMainBox = function(){
return this.isOutBox ? this.iframe.contents().find('body') : $('body');
}
H.prototype.loadMainBox = function(location){
location = location || '/main.php';
this.iframe.attr('src',location);
}
H.prototype.loadDocument = function(location){
this.document.location = location;
}
// ======== storage
H.prototype.set = function(key, value){
this.data[key] = value;
}
H.prototype.get = function(key, defaultValue){
return undefined == this.data[key] ? defaultValue : this.data[key];
}
H.prototype.setHP = function(id, curHP, maxHP){
curHP = curHP || 0;
maxHP = maxHP || 0;
const hp = this.getMainBox().find('#hpKey_' + id);
if(hp.length < 1){
return false;
}
const hpA = $('img:eq(1)', hp);
const hpB = $('img:eq(2)', hp);
const redHP = 0.33; // меньше 30% красный цвет
const yellowHP = 0.66; // меньше 60% желтый цвет, иначе зеленый
if(curHP > maxHP){
curHP = maxHP;
}
const text = curHP + '/' + maxHP;
const lengthHP = 170 - (text.length - 1) * 8;
const sizeFirst = Math.round((lengthHP / maxHP) * curHP);
const sizeSecond = lengthHP - sizeFirst;
hpA.attr('width', sizeFirst);
hpB.attr('width', sizeSecond);
if(curHP / maxHP < redHP){
hpA.attr('src', '/i/1red.gif');
}else{
if(curHP / maxHP < yellowHP){
hpA.attr('src', '/i/1yellow.gif');
}else{
hpA.attr('src', '/i/1green.gif');
}
}
hp.html(hp.html().substring(0, hp.html().lastIndexOf(':') + 1) + Math.round(curHP) + "/" + maxHP);
}
/* ------------------ перехват клика по логину юзера -------------------------------------------- * /
H.prototype.setGrabLogin = function(input){
var obj = this;
this.clearGrabLogin();
var tmp = $(input);
if(tmp.length > 0){
this.grabLogin = tmp.get(0);
$(this.grabLogin)
.addClass('grabLogin')
.dblclick(function(){obj.toggleGrabLogin(this)})
.select();
return true;
}
return false;
}
H.prototype.clearGrabLogin = function(){
$(this.grabLogin).removeClass('grabLogin');
this.grabLogin = null;
},
H.prototype.toggleGrabLogin = function(input){
if($(input).hasClass('grabLogin')){
this.clearGrabLogin();
}else{
this.setGrabLogin($(input));
}
}
/* -------------------------------- простые диалоги --------------------------------------------- */
H.prototype.sdOptionsDefault = {
formMethod: 'POST',
formAction: '',
formClass: '',
title: 'заголовок не указан',
width: 250,
data: {},
content: '<span>контент не указан</span>',
onSubmit: function(){return true;},
onClose: function(){this.remove()}
}
H.prototype._sd = function(options){
options = $.extend({}, this.sdOptionsDefault, options);
const m = $('<div class="sd-container"></div>').css('width', options.width);
const t = $('<div class="sd-title">').text(options.title);
const c = $('<img class="sd-closer" src="/i/clear.gif" title="Закрыть окно" alt="X">')
.click(function () {
return options.onClose.call($(this).closest('div.sd-container'))
});
const f = $('<form class="sd-form"></form>')
.attr('method', options.formMethod)
.attr('action', options.formAction)
.submit(function () {
return options.onSubmit.call($(this).closest('div.sd-container'))
});
for(let i in options.data){
$('<input type=hidden>').attr('name',i).val(options.data[i]).appendTo(f);
}
if(options.formClass){
f.addClass(options.formClass);
}
$('div.sd-container', this.getMainBox()).remove();
return m.append(t.prepend(c)).append(f.append(options.content));
}
H.prototype.sd = function(options){
const tmp = this._sd(options);
return this.getMainBox().append(tmp);
}
H.prototype.sdOneInput = function(options){
let onSubmit2 = options.onSubmit;
options = $.extend({},this.sdOptionsDefault, {inputName: 'target', inputValue: '', grabber: null}, options);
const i = $('<input type="text" class="text">')
.css({'width': options.width - 45})
.attr('name', options.inputName)
.val(options.inputValue);
if(options.grabber && this[options.grabber] instanceof Grabber){
this[options.grabber].set(i);
}else{
i.select();
}
options.content.append($('<div></div>')
.append(i)
.append('<input type="submit" class="button" style="width:33px;" value=" »» ">'));
options.onSubmit = function(){
const v = i.val($.trim(i.val())).val();
if(v.length <= 0){
alert('Не заполнено обязательное поле');
return false
}
if(typeof onSubmit2 == 'function'){
return onSubmit2.call(this);
}
return true;
}
return this.sd(options);
}
H.prototype.sdLogin = function(options){
options.content = $('<div>Укажите логин персонажа:<br><small>(можно кликнуть по логину в чате)</small></div>');
options.grabber = 'grabLogin';
return this.sdOneInput(options);
}
H.prototype.sdItem = function(options){
options.content = $('<div>Укажите название или s/n предмета:<br><small>(можно кликнуть по названию в рюкзаке)</small></div>');
options.grabber = 'grabItem';
options.width = 270;
return this.sdOneInput(options);
}
/**
* Функция для обратной совместимости
* Не надо её использовать в новом коде!
*/
H.prototype.sdFindLogin = function(title, formAction, inputName, inputValue){
return this.sdLogin({
title: title,
formAction: formAction,
inputName: inputName,
inputValue: inputValue});
}
/**
* Функция для обратной совместимости
* Не надо её использовать в новом коде!
*/
H.prototype.sdFindItem = function(title, formAction, inputName, inputValue){
return this.sdItem({
title: title,
formAction: formAction,
inputName: inputName,
inputValue: inputValue});
}
/* ----------------------- вывод системных сообщений -------------------------------------------- */
H.prototype._popupConfig = {
'd':[10000, 'Отладочное сообщение'],
'i':[3000 , 'Сообщение'],
'w':[5000 , 'Предупреждение'],
'e':[0 , 'Ошибка']
}
H.prototype.msgPopup = function(type, text){
if(this._popupConfig[type] == undefined){
type = 'w';
}
const conf = this._popupConfig[type];
$.jGrowl(text,{
header: '<img src="/i/jgrowl_moover.png" alt="<>" class="jgrowl-moover" title="Передвинуть"> ' + conf[1],
glue: 'before',
life: conf[0],
sticky: conf[0] <= 0,
theme: 'msg_' + type
});
}
/* ================== перехват клика на логине/шмотке и т.п. ==================================== */
function Grabber(options){
this.options = $.extend({}, this.optionsDef, options);
this.input = null;
}
Grabber.prototype.toString = function(){
return 'This is Grabber-object';
}
Grabber.prototype.optionsDef = {
inputClass: 'grab'
}
Grabber.prototype.get = function(){
return this.input;
}
Grabber.prototype.isActive = function(){
return $(this.input).is(':visible');
}
Grabber.prototype.set = function(input){
const obj = this;
this.clear();
const tmp = $(input);
if(tmp.length > 0){
this.input = tmp.get(0);
$(this.input)
.addClass(this.options.inputClass)
.dblclick(function(){obj.toggle(this)})
.select();
return true;
}
return false;
}
Grabber.prototype.clear = function(){
$(this.input).removeClass(this.options.inputClass);
this.input = null;
},
Grabber.prototype.toggle = function(input){
if($(input).hasClass(this.options.inputClass)){
this.clear();
}else{
this.set($(input));
}
}

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

View File

@ -1 +0,0 @@
<script>top.location.href='/index.php';</script>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1,241 +0,0 @@
GIF89a`р
Т а l0 „ч]RГьБB (pИ
ШЂци#R;ЎKЅ /Р0(АCЬ
М
SPя@
4°CБ† Д1K,А#
ЬД#0°
ЊL“AєHаB9чЬАE5zи`E%E<pЃЊд0й
A7Ь!Е=ОР’Бµ
р
<0З
¶„ў
,Ы\АMшArX
¶ШДИЃ
 н№pД)4АXLb† 2аЂT,ЃС`D=ЊАЂY\a@@КАИ^f%"@@<`o€BS˜Eк`FPб   €А$! 7ЂЃґа!Аа
hЂ X@
DaСђѓ
Ђ
e`$0…<  @†и°
&$
™6CX…,ђpF`Ђ
 
КВКИr@…^pc.Ё‚€aЂЖИЄbkт‡L$AЊ(B,,@„=˜AёЕ
0 4a
c`” ;!
0@М8@0ѓl
"ш­|M2‰?  
3,@Њ`АP…7n` иl!„И Ђ ®0ЯD А pЌ*HбqЁГ: ЉS8.€БцAEАб`˜А!Ф#[h@
жШЃ а а‡9 ГYNґE@
h(рђЎ20‡ўw-$°‚˜А p
ST"°xФC‰с[PѓVЂXр8Аq€А0<@0
Y
4Ѓ—ЏzA
°Bњ`gPњ3Bp3<АB ЅX† Цp‰@°Ў|°Ђ
ђ €(иВUШ‡~0ЃњpЃ
†`Ђ=Ша„ё„ФпIА aЯИz,±n$Г?pѓ
АаЂѕ°”c@ВаҐ>ѓ
ґ#"ИЂ$шa€ м  (& l xЃя
ЉРсЩњƘАРЂ,шв
ЮЂ @
" ј0ыа Д
1`
0иqL
р
;PO@
mа р < гаЌЂ “SА6хїpkрк°„нvѓPЏр
…P—P M
˜Ђ!А‡м6
г
<а V г№@hЬрј°‡®ёkЙА J`
И`u0'АH
а_рк
6
џяp ® E
-
GаЎА РО
@@™he04 30ьPЈ%LњБ
o`
Ача
LР°М`“PWрЇ@1¦Ріc с
°
 Л@
uяЂЩ”`К0@@јj@-0Q
Ђ
ЛР0pЉ ћ@/ Ђ¦
jР Q€Б00P К@wг@p
S  саP@Lj&рCа `%P
5P
*0ђ
bP“яp’рҐтЕ«ѓ
і°
ц
.
Ћ
« «pћ``а@0дц @7Ђf°
сp6
пєX
Yа
F0 p_@Pі' ЫPAА
с
F
Q°©Я
·"р4рU% 
зЂ p 
Lp3p гP ґбЖ
¬
Эрц
р

л
ё@ЯKR ` 304@HР
,O™°Qаи
A П ї
7 ¶0 Ў@°
°
@
°А р-`JР
"ЊА™АPЬKў`  %H
"рё ; `ъјHSАСц (рp¶А
“Аc`
 Z0rа‚°° 0Аp,L
@ХWTЄ
&p РV?„=B@Ђ “p ј T`б \0«*  Mа
4я@"4ЫуS X
Є0C +t:
fP
S@ +
џа
Ю@ У`4р4@b`™°
ЭЂ<а У0ґЂ'
€Аа €Р”р Ѓ~ґp
 ѓmА @ Ч`иmо;uP…Љ/р UА
УР
Ю0°йЌНэЕiPvJЂЂ
r@аn
Р ј@dА" ёЂ ч° т q`
ЌаҐ@аr ЕP ё`T п\“°Ђ   яђЂ
ШђШР Ч7иЂ
ЃЂЫ РЩ
»Ђ
%Р‰Р2 
>PMЉ` /`
Х0БA0" »аЬ0
 ђ
С‰ы
7 
Ћ< "eЃ
%
FuВуПгGђ!EЋ$YТдI”)U®dЩТеK˜1eО¤щ±]p-ui"W+!љ!ЙV€I4Оз†4°«ѓжЃ0 agК
Ш (Е%]ЪфiФ©KѓЈ2„ 8ит*я8ЊE€Б€‡ЖI$
ђаI6адЉ.#
 b t`x@8bИД‚ё
,'‚щ 2Ћ8ЋшДЊ?к8 њx$s¦[б!•uVZ»„3ШD
f¬`c>6Ў  *P&ў CУ,<h ЏU0€†•#X@
4ЪP…вЙў\`ёбґШѓoVQd!\( DВ±'Џ$м@f{pЙdюE]Ћ;ц8%jґ
,thЈ :¤1 h@
АЄЃ [bўXАрAh8' 8pbV ! 5˜ЕpЬsW2‰#DЙ!оёжI:ИBЃОiА‰KМС Ѓe”Ђ!"Ю°@b0]”
Jс
0˜ ѓ A$P†ЊSўЇtВ
АЂ­HD АB/˜Ў  ЃI  
р
`CтE 5ААo«Б<°‰RШа
ВАЉY(I(h,d C
@ <ёаШ‚Ѓ
Ё‘Пt0n8ЋАЎг€¦#5@Ає^@ЂХЎґ
Ю0€Oґb¦±Зh
ЊгPрG9<
xрA(€!oP
0BЁ°``

"дЃ
с ё
ДЃT@b4Д§iЉp…*њ  DPѓ
T€ЂHШBEDH[а
Ђ-°Ђ,ИЂL   
@B
Xqx:аѓ_hѓIшЂ)ЁњJ“
ё„°ЂZXГ¬MЏHLFЂ…8
ИЃaРЂOИN 
 „:
иD8ѓ(`Ђ)Ё…X… ˜
˜Ђ(ЂЂpp„Ih‡`h
3@Ђ„кд…Ђ‚€‚˜ЃeРЂ/
XX„&˜7.@…яАѓ_° P„&@Ѓ# ЂBёЂ
а˜„+˜¬F€ѓ`шѓU€ѓз€f6@
F˜X`‡'ЂЂђА
8ѓjИЃ?„4 "шЂhшё°`8ZЂёЃ@Ђq`ЃшЂ4X…L †7ИлбЂ-Р
˜Ѓ\а5 °^
Ш†{ YP*Ќ«9
 °v
°ЂBXz
ЂЂ+ s?XD@I ЂЂ:(8 WxЂ&hЃp
˜
ђ
Ђ†‚! P
K&¤›Д+A т}5j №Wя6rмис#Иђ"G,iт$К”*WІlйт%̘'Ђp@LЃџ%PnрРcќИ±°"ЈfLђ˜pЉ‚ ,ћ!qzєЅБG*˜¦ШђИ,kц,ЪґjЧІmrМ¦q:КL+РџиDЬшЇP
ЌТy2 
ґЅ€%«Ґѓ­!т©`уА‰ &«к-RѓWFЊPБџЁQG гХў‰1„4аJ8!…@С
Р$`@
ў/ s|СВ&њЂG*4<б 9Р±FkЬІ$kTрД7%h0ЖљDc В8еl(­µЪєќ:$pьАKл¬sЕё¤бЂpИўF#|@…»Ир §
xs€npЎЗ.0dЎИ|А>GLа‡:sиІЖтВМJД“
0\ЃО€ D?5ґђЕлzь1И&бЖ*Ф,
7\Т‰лtRяВ2f(І^4rЉVxбG§!$Г…ЌЂрBЉФ
_‡м 
СJИQKІ-A€ІBЬC,•ь@ЖЫ@В ЎЊФЊ
Мd^мhЈЌiTcИш4sF$~Ф’
;СЂє«їѕwY\@ЊQK%EьO-2мяB:( Р€g¤аBH@'X
%А 
Р
+\в
@(B(Е)¦eA€Б5F1Ѓrђ n@E"ш
ж@aд""РГ'2P…
‹ђ4ђИ]тІ$H З$0aD@
PЂ …hA)<0
#
ALHб P&.0ѓФ` Уђ
ўД @JщѓwАЂ@П‘тТ
p†!ЂK4®(@
"РHH"…ёE~ 
 / YјЂ°ђБ%.Ѓ‡ёў$Ѕк!kAАhА:XC3
1cH"±яXД¦qмѓ®Р>†РЂ -ёЃ
%шF
J<б W
ЬвQ`ЂђаЂRвѓkа‡.\0
иaнр‡АЃPАЅћљ&Ж1
Њ1XnsxѓЊ* DгьрЂоPЏїzа 'ЅБ((°Џ—№ahжPЫ3dp%®±Ѓ;дѓCЁ„: б…B`b§ё1ј
"Ша?Ш0іє1X
ИЗ
"`qш/вр‡р
vЊ"(±ю6 фя

ш ;и„$@ oL#5АP np€%xаЇ B¶Щ°‡'иБi(A ж я
ДЈµhA2>A‡є“ћ;Z(Б ё
ЊАMX†!ЖЃTa˜`¶Qq(  z8"Ѓ 
5Фc Н Г pѓuА"KЂЖ2(Рю< WђDЄ
lГNxВ¬
†a[ШЂтЃxВP@
В иЂ#ж"ZшU pЂ"ЬЃ,
јC B7@D<@Ш
0>d@;иў8…muВ3PB4ёЂаБ$шГЊ8¬ЃґяАмђд@
ђA!d
ИL
Вм
¬?¬Ѓ6ИA!Hђ@
Ф‚,Ьd@=$ЁЉ–А(ФB xЂ*ш@;Б%ЬЂl@Ф
ъ;
јАрЃ°ѓ,р ,BHВИ
<
ь©ЉюБ p4$Г 8ЂГ8@@ЬЃTЬВ


Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 536 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1 +0,0 @@
<script>top.location.href='/index.php';</script>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

View File

@ -1,241 +0,0 @@
GIF89a`р
Т а l0 „ч]RГьБB (pИ
ШЂци#R;ЎKЅ /Р0(АCЬ
М
SPя@
4°CБ† Д1K,А#
ЬД#0°
ЊL“AєHаB9чЬАE5zи`E%E<pЃЊд0й
A7Ь!Е=ОР’Бµ
р
<0З
¶„ў
,Ы\АMшArX
¶ШДИЃ
 н№pД)4АXLb† 2аЂT,ЃС`D=ЊАЂY\a@@КАИ^f%"@@<`o€BS˜Eк`FPб   €А$! 7ЂЃґа!Аа
hЂ X@
DaСђѓ
Ђ
e`$0…<  @†и°
&$
™6CX…,ђpF`Ђ
 
КВКИr@…^pc.Ё‚€aЂЖИЄbkт‡L$AЊ(B,,@„=˜AёЕ
0 4a
c`” ;!
0@М8@0ѓl
"ш­|M2‰?  
3,@Њ`АP…7n` иl!„И Ђ ®0ЯD А pЌ*HбqЁГ: ЉS8.€БцAEАб`˜А!Ф#[h@
жШЃ а а‡9 ГYNґE@
h(рђЎ20‡ўw-$°‚˜А p
ST"°xФC‰с[PѓVЂXр8Аq€А0<@0
Y
4Ѓ—ЏzA
°Bњ`gPњ3Bp3<АB ЅX† Цp‰@°Ў|°Ђ
ђ €(иВUШ‡~0ЃњpЃ
†`Ђ=Ша„ё„ФпIА aЯИz,±n$Г?pѓ
АаЂѕ°”c@ВаҐ>ѓ
ґ#"ИЂ$шa€ м  (& l xЃя
ЉРсЩњƘАРЂ,шв
ЮЂ @
" ј0ыа Д
1`
0иqL
р
;PO@
mа р < гаЌЂ “SА6хїpkрк°„нvѓPЏр
…P—P M
˜Ђ!А‡м6
г
<а V г№@hЬрј°‡®ёkЙА J`
И`u0'АH
а_рк
6
џяp ® E
-
GаЎА РО
@@™he04 30ьPЈ%LњБ
o`
Ача
LР°М`“PWрЇ@1¦Ріc с
°
 Л@
uяЂЩ”`К0@@јj@-0Q
Ђ
ЛР0pЉ ћ@/ Ђ¦
jР Q€Б00P К@wг@p
S  саP@Lj&рCа `%P
5P
*0ђ
bP“яp’рҐтЕ«ѓ
і°
ц
.
Ћ
« «pћ``а@0дц @7Ђf°
сp6
пєX
Yа
F0 p_@Pі' ЫPAА
с
F
Q°©Я
·"р4рU% 
зЂ p 
Lp3p гP ґбЖ
¬
Эрц
р

л
ё@ЯKR ` 304@HР
,O™°Qаи
A П ї
7 ¶0 Ў@°
°
@
°А р-`JР
"ЊА™АPЬKў`  %H
"рё ; `ъјHSАСц (рp¶А
“Аc`
 Z0rа‚°° 0Аp,L
@ХWTЄ
&p РV?„=B@Ђ “p ј T`б \0«*  Mа
4я@"4ЫуS X
Є0C +t:
fP
S@ +
џа
Ю@ У`4р4@b`™°
ЭЂ<а У0ґЂ'
€Аа €Р”р Ѓ~ґp
 ѓmА @ Ч`иmо;uP…Љ/р UА
УР
Ю0°йЌНэЕiPvJЂЂ
r@аn
Р ј@dА" ёЂ ч° т q`
ЌаҐ@аr ЕP ё`T п\“°Ђ   яђЂ
ШђШР Ч7иЂ
ЃЂЫ РЩ
»Ђ
%Р‰Р2 
>PMЉ` /`
Х0БA0" »аЬ0
 ђ
С‰ы
7 
Ћ< "eЃ
%
FuВуПгGђ!EЋ$YТдI”)U®dЩТеK˜1eО¤щ±]p-ui"W+!љ!ЙV€I4Оз†4°«ѓжЃ0 agК
Ш (Е%]ЪфiФ©KѓЈ2„ 8ит*я8ЊE€Б€‡ЖI$
ђаI6адЉ.#
 b t`x@8bИД‚ё
,'‚щ 2Ћ8ЋшДЊ?к8 њx$s¦[б!•uVZ»„3ШD
f¬`c>6Ў  *P&ў CУ,<h ЏU0€†•#X@
4ЪP…вЙў\`ёбґШѓoVQd!\( DВ±'Џ$м@f{pЙdюE]Ћ;ц8%jґ
,thЈ :¤1 h@
АЄЃ [bўXАрAh8' 8pbV ! 5˜ЕpЬsW2‰#DЙ!оёжI:ИBЃОiА‰KМС Ѓe”Ђ!"Ю°@b0]”
Jс
0˜ ѓ A$P†ЊSўЇtВ
АЂ­HD АB/˜Ў  ЃI  
р
`CтE 5ААo«Б<°‰RШа
ВАЉY(I(h,d C
@ <ёаШ‚Ѓ
Ё‘Пt0n8ЋАЎг€¦#5@Ає^@ЂХЎґ
Ю0€Oґb¦±Зh
ЊгPрG9<
xрA(€!oP
0BЁ°``

"дЃ
с ё
ДЃT@b4Д§iЉp…*њ  DPѓ
T€ЂHШBEDH[а
Ђ-°Ђ,ИЂL   
@B
Xqx:аѓ_hѓIшЂ)ЁњJ“
ё„°ЂZXГ¬MЏHLFЂ…8
ИЃaРЂOИN 
 „:
иD8ѓ(`Ђ)Ё…X… ˜
˜Ђ(ЂЂpp„Ih‡`h
3@Ђ„кд…Ђ‚€‚˜ЃeРЂ/
XX„&˜7.@…яАѓ_° P„&@Ѓ# ЂBёЂ
а˜„+˜¬F€ѓ`шѓU€ѓз€f6@
F˜X`‡'ЂЂђА
8ѓjИЃ?„4 "шЂhшё°`8ZЂёЃ@Ђq`ЃшЂ4X…L †7ИлбЂ-Р
˜Ѓ\а5 °^
Ш†{ YP*Ќ«9
 °v
°ЂBXz
ЂЂ+ s?XD@I ЂЂ:(8 WxЂ&hЃp
˜
ђ
Ђ†‚! P
K&¤›Д+A т}5j №Wя6rмис#Иђ"G,iт$К”*WІlйт%̘'Ђp@LЃџ%PnрРcќИ±°"ЈfLђ˜pЉ‚ ,ћ!qzєЅБG*˜¦ШђИ,kц,ЪґjЧІmrМ¦q:КL+РџиDЬшЇP
ЌТy2 
ґЅ€%«Ґѓ­!т©`уА‰ &«к-RѓWFЊPБџЁQG гХў‰1„4аJ8!…@С
Р$`@
ў/ s|СВ&њЂG*4<б 9Р±FkЬІ$kTрД7%h0ЖљDc В8еl(­µЪєќ:$pьАKл¬sЕё¤бЂpИўF#|@…»Ир §
xs€npЎЗ.0dЎИ|А>GLа‡:sиІЖтВМJД“
0\ЃО€ D?5ґђЕлzь1И&бЖ*Ф,
7\Т‰лtRяВ2f(І^4rЉVxбG§!$Г…ЌЂрBЉФ
_‡м 
СJИQKІ-A€ІBЬC,•ь@ЖЫ@В ЎЊФЊ
Мd^мhЈЌiTcИш4sF$~Ф’
;СЂє«їѕwY\@ЊQK%EьO-2мяB:( Р€g¤аBH@'X
%А 
Р
+\в
@(B(Е)¦eA€Б5F1Ѓrђ n@E"ш
ж@aд""РГ'2P…
‹ђ4ђИ]тІ$H З$0aD@
PЂ …hA)<0
#
ALHб P&.0ѓФ` Уђ
ўД @JщѓwАЂ@П‘тТ
p†!ЂK4®(@
"РHH"…ёE~ 
 / YјЂ°ђБ%.Ѓ‡ёў$Ѕк!kAАhА:XC3
1cH"±яXД¦qмѓ®Р>†РЂ -ёЃ
%шF
J<б W
ЬвQ`ЂђаЂRвѓkа‡.\0
иaнр‡АЃPАЅћљ&Ж1
Њ1XnsxѓЊ* DгьрЂоPЏїzа 'ЅБ((°Џ—№ahжPЫ3dp%®±Ѓ;дѓCЁ„: б…B`b§ё1ј
"Ша?Ш0іє1X
ИЗ
"`qш/вр‡р
vЊ"(±ю6 фя

ш ;и„$@ oL#5АP np€%xаЇ B¶Щ°‡'иБi(A ж я
ДЈµhA2>A‡є“ћ;Z(Б ё
ЊАMX†!ЖЃTa˜`¶Qq(  z8"Ѓ 
5Фc Н Г pѓuА"KЂЖ2(Рю< WђDЄ
lГNxВ¬
†a[ШЂтЃxВP@
В иЂ#ж"ZшU pЂ"ЬЃ,
јC B7@D<@Ш
0>d@;иў8…muВ3PB4ёЂаБ$шГЊ8¬ЃґяАмђд@
ђA!d
ИL
Вм
¬?¬Ѓ6ИA!Hђ@
Ф‚,Ьd@=$ЁЉ–А(ФB xЂ*ш@;Б%ЬЂl@Ф
ъ;
јАрЃ°ѓ,р ,BHВИ
<
ь©ЉюБ p4$Г 8ЂГ8@@ЬЃTЬВ


Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 804 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -1,280 +0,0 @@
GIF89a`р
zdіuf@y°ўЂ_u,&x(ЗЉт
%Д0€бHБГ(^X2Гн

ЂигЏ.
Г
ODРL <( Аv ЈЂ

њ@Ќ
"€Њp‰&^Р!NGpаџzQNV <ДўЂ ·`p…0yа`иЄ¬T "ёtя@Й"‡8a8ЂК01
@
т
ФУK€xЌёBЛX+ЗB4ёp`Й"„а
Y'›Л
`CH> —ЊcЗ jАг ±рZ`0C2†ДГE+Шв
чШЕDpЂm ЛG
В.!VHў„$ра д!P $TЂ)
u
¤Iђ°dJ$@ ‰m8
@
Cа%P эЁCДр
Ђђ2h@ Шр
мёД', )ДЃl°аЂdxAррђѓmРБnс€0X яыhBђз/ґc %ђЂ.ШFС‰N 

a09ьЎФшa 
ёЂ$°‚*ё џЂ
H!
®яиBд! p! «Ђ *` EђCПщ?шР

mЬб
ТУБСX"А…%,БЈ
dаuиЃ5„`Ћlб
bЈ. ЂQt
˜z°€l,ВЏАEґQ ¤B
ЁHыБѓР ЬѓЮю
Tcј@ј+`xґгCИ‡®p‰," р*Аѓ1A¶°%6б‰m|aљПv jЂAZР
ЃР —°
A0IpЈ` cpв G𠘠
Ё~PYHgY0
hр
ѓя@
B
лpc`
а­ђ& у@v' ``<pИ00
7p
са
<А8 'Ај
¦`
џ0 ‡р +0%p]Рћ`€M0|P
®а
ТР 
Ђ‹ии` С° 0ыpы ¤

 *а±Ђ #  а пV
р o  7 Р
\a—ЫEѕ

Oрa0 -
Zяђ°њA@
0 miQ0г
p0
 
тр)sа
cPЧ№Z*P
ЁP=
3 SsmP
.PXХP‡а® А°
OЦЎ Ќ"Р
ы НPЈWа^
Ыа
ВPE @ћРcOяp
9а
 ¦wҐ
°
5 2jTPp)“L¬Єђ©Р
K
b їZQ^а± @дђ
ааєА±WА‰АЫ
О@PZ
0©Pђ
°«KV ; К
бj
 Wр
ѕєє‚”Пђ
ѕ й‚†p
 
с
 АрL$po
] ЕU®Ђ
зў°
НђжKp
”А
А
$p5Pы‡
Щp
Ё0
oА@#p
pPљ HЂ8нМ>#@
@ ®
рћџАлPН>Ца 
Аp‡° Ђ [РL`„µ
{pGNђР/а
"R  ѕhР`
u№Ф№cRpКбд3г0g
p`'ѕ0
”p
R Чєг з`ђЂ « iа^`V`
џђД 
рч
рљ0ВPЏp {PЭЉ“¬ђtа  iPїр-
j
Ѓ@
і°Лp!—рЃp дЗѓЂBhFр#`.NаЏP 
дрѓжЂz4,Р іР=p ј0·Ђ j`
Р°Е
Џ•–;`ҐP
ђћАФЂ-`/Вp! _аѕ
¤Ђ ЊЂСЋ@РЗ–ЂцZjђѕ2А LрЅА
„ 
ѓ
@„рPл.pк° C`о
ѕЧP
’ыЂ
@Н0
@
˜Ђ
 ОN0 _0
ГPѕ`0р™`?фХтfїщђtP0Ґ°x
Й
п@!
GР
n_-?Yp
Й°
0†°0
а}oАQр°Љ`z`h  …Ђ
­Ђ{S
ЏV”xІ)2JB„)ЧоЯK˜1eО¤YУжMњ9uодЩУзO A…%Z4ж­3Ъґё‘/ќ8mаLХ%@ѓJ”hhЖjКшк‚А`ћ°›у@Ђў1Dt9`щМи]јyхоеЫЧп_ѕD„KоЖ?LwДЈC /prL«ҐбБWtl«бкБ˜+ћШ0РЉБ™c ј9qвЌ:А±eП¦]Ыцям ‘‚¤щг'B) \QЎу‡LЂЄєРЙсЎБ›бDдpЃ@°'@І`‡oIP<y…ЈґЫйХЇgЯ^ц¬
K0оП
T\lЙИU„ 
C(ёaЉ.Дђ
ВҐЌ8Ђ№@e¶ЎG
`Јљy
вИЗЏИ`!€!ђ`ЃT4ЂЉ8¶‚†
 „‚$¦T oЙA
ў€GXzлµw/VОшѓ?ЩaЃ)Ћш…Њp(
ш ?D№AћrPRAeЂ#l@`љe°Б8Ш `‡{SVyеќ^€$Џ ёЃ
PВ€Hёа?V
тx Ѓ<PqўљЖ9ўpД ! +”€я@ѓ&HЂe®»жЪЏ"‘ЂЋвx!Ѓ8Ja…Jц1!Ѓ.4p„2ИбЂFHе)FЎвЌyH@
ш¤‰RИA*$~ш,…L$
њ@„|\№aЃqB§д°6r(вЃm
…XВ
†}В
8ВZС|  В(аЉ(hЎ„S¤"_„±
µбНpН@МcшЂ+˜ „|ЬњyHбзШ7@ЊV, P Т »д
U$d!‡вЬЂ/@Ў+H6\C ШA
а@”в–)(Бђі¤ҐNДс‡fфлёF.wр
ФА ¬ЁЗЮр†+\б°Dв¦p*шБњ­eкр‡а
,   .˜FР?B
ЂБ(ђ
HГ"шQ
rґЂ рQнZB'dАXЃЂch†ґ> ЊL
D`яЧаЃ8B
n,ЃyCXAg  °…
ЗАЄ1ѓД"hЖ9ЋUDЗ¶ђѓ@$Ў 0D2 Tм&ШkЬ°гЋa4(вџ8Ѓ8L
#F2rЂ= ФhЃ(0ђc4ЯЛ“hБD„H¤`ш@Pс!,ў—P)8Р/ А шЉ–° G”Ј‡@Е <b9GО
e¤YУВъЖ(‚°Cг!p…P p8В
`
а='0`Вў`

JcЊ˜аґИ!¶рЉT
А!˜РЊZlb¦
ЮАдQ °Gѕ={рE5сЂ=ЁBрЂ

lbEXЂ*bБ%€в:hМБNг‡рЃ=Za
 ўMРЃ2СрAѕXВ"А‰ЈB*h1„рўёXDснO <# шD1ѕ
`|p/p "X
®s)БЖЩBCД VђЂ1€†THИ 
РѓЂN˜|ђ‡ РА@
 Ђ{Ы„LађGф+ЂРP…ђЌLJњр
АЂfP3pn@ЂА\ C(„
р„.°ЂХёc 
Ё… Ѓ]ј<M˜pIh…@x3вЃРjа,pC .CА‡V„я
ё„P…TШ‡yPOPЖBh(Mшќ"ђ&p0°‡'8M8m p`ќґОУlHWђ@H3Ђ†pИЃЁЂ°Ђ8ё@xѓ*ђѓR˜
`ш
Ђzp…·1†LЁ‡аwАЂnи†rђЃ7РЃ T@ЂXbХHP
x
 „/0ѓА†I@
Ь
€‡T8ЃsEш
@(+аUа4 z(Ђ
ЌH†°b ѓ#МЃ7rЩp Рѓэ†‚ рЂCxWHw9и9 Ѓ%x„`Ђ+ё‡`†h8ё·{
(Ѓ+P.`HX€mђ…fр!АЃXР_ XPЃ@‡"8&P

щaъ`k˜QJJ 11aЉ
ш9yЕ Tvј1T W
]ґ˜Њб‚Цdw&=тFћЇCаDR­jх*Ц¬Z·r•(¤ЧНфЃ
АЂя=щРх1дИ'SЋМU8ЋЂЂ`А“(,*˜DВ=xрh Ћ#ђRDaѓ
!
шП0ф<a‡3V0`

0xpВ0aМ¤ГzіђВ лґ3‰vH@Ђc\ 
"јLSДp8°В$0Й(H ;ё2Imzъ)ЁК!0Г \rB([Ёа; сБ€ётГ(*И M&рbВ&<ў„J ІИ
E|Бѓ·МУА YјP‰*є„:-µХb%FГ|
нрAяЋ
‡4@†$*|3О7W#Д?Zн4гЃЎис†VиAHPLў
#Оа‹“<ѓAЏlЊjkѕА0`J3*„РЃЦшў
„ўЌ
$@p6—Р±†Ї(р…Х€AПфdв|гЏ%Ѓ„бЃІ ГИ”PbяЕ-† ±Ву(АЙАah@" М ‡xЂ* Њ5ґб B!†zА ёЂ,fрЉ+8a—°†TС
Ш@(((Б °†6МJѓ@@ , ЃЁбN@с
^  p8а ј°Ђ!=¬гh;Nа _А ›ИБ
УЁЖЏ„AрE` ЂHNИЂ/v DP ЮаЃ%^Ѓ‰ЁaЏ8Ѓ
ЬСkHCГЂЂ"ўQdЂ+€…
¬±“ћґ€ћРѓ г nА  в
¤
4„A}PБ+јаЊ+Ь!”ђ…2ёђЃh¬гuАР1НЃ~ Ж
h †{Ё еЂЂ
’±+°@
‹Ёз$d1Ё`
k(,ЊЃґ¦jЊЃК1xАaHEb1ѓdЬб
2яX
 
4ШБ·(Г$
5
а˜&†¤ЅXCј 
\A8XБ.v! (иБ_ИA@Ѓ 4 ЉQxЈСр
ЊРѓ
ьЂBЮЂ gфЎоµ&T`Ј
В
2A uh‡˜Z ‘в@aРВК JшBW
вnѓ;а7aкPЕ РаD(А@˜‡Сm@pж0_DИ°
Ь-3TЏш'ІђЉ)ЂYPGк!Ѓ Bзp‡
Ј
д`АЂР‡^¬Аޘn
ўРоЌЫи{Рѓ$TРrГ[А<z„Гь8Ћ
2Аѓ\cЂЋВБЂjH
'РА!јЂЉBHбУ-B­T,
&P„`
jРґъю§Lј"|В
H
4Г!0Ap˜ѓҐ
Nбc”Г
„‚Ш@ЊЂЯ0”Т Ѓ5рБ6Њ=dCМ
шобVњA?Ђ%њ@=€ЃЁѓ
<@
¬ЂXѓ5„
ФХМ
<А2pА Ђ
њ
<
Д@"9S
. 
C
ЁCЃ
0#„&ЂA¬Cё%јБ_М
АЊ.аB®
АA ЊВ ґѓ®|@
Б%
Аp
=Ёw^A
$яГ$pA8м(„ѕ‚ ѓ%фB
˜A`=PЂP”~§АА:˜А+8Ѓ
Њ@0

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 536 B

View File

@ -1,268 +0,0 @@
GIF89a`р
JґЁСЈH“*]Кґ©У§PЈJќJµЄХ«XіКµ«ЧЇ`ГЉK¶¬ЩіhУЄ]Л¶­Ы·pгКќK·®Э»xукЭЛ·ЇЯїЂ7„бб«N`2Т
XIЊЁђЭж„чЗ4FдђёсH( pИ$g°#G0ЯЉ
1ѓ€3 8 Ћґ `
!p1MhdРЊ
УЖ/F¤бљ¤*DЂT$b!pRBrьяБ˜HрD
Ѓ]n!#D”АА
˜
л4`CЁМpЖ,J,вA;A
P”a
МИq
5дУО6ПpЃоАѓ‚ Б Ђ@8 tУN(QМs@‘П e0Ѓ9ёУXb€…њ
РЃ9hИМ|±Аи G0е Р†2;њPД/TЂ`ђѓ yP@>j`Ј !@Г
m0P\ђБ‚Ў·°Ая.
˜ѓDР„бЦЃTt@Б`Ѓ ъ`( @h˜Ж*О±Ђt@'XЕЁћx&м"ZXB0 Ђ5Д@sЛ°„@€D|a ќђ#И2”ГH 
Б˜ЃlQ
d˜А.HЃr”@ +РЗ(я1Њ! ТA ЂpL™Гњ€ѓ"q7 КШ9О¬a_(ADqXб·рA.  dР
є"„@ hB а
U
сѓlјAp5~PЉND# ˜Е%lЎ„!я<Ўe
Д@Bжђ‡u ЈЛђ…-т`?њў

.8‡owЈN@ѓ ЋРЈ/8B р
6°BЯ AHp
@`а(
@q8
tВя€Dј гГ@mЂЖ6¤!CМА€@
`в x0C *`†tЁѓ ЊA:ў-ёEјЃXр…АЂfђЂ
ЦЂ@ p°ЃoT@5Ё@кlk`ZЪѓ \В!0ЗЁАЂв<pГ`NрАJ(…±Ќґ` Ш
P„-dў
O(
шАГ3Ю1ђЃ &H@#уї
4A
Ў†–.0џA
рЋ
ЗР
bа ОЂ"P
Й pL`зЧ
° 4`хў
ДЂz
hр ђpЏРМ`Гdђ !Р%`b`ЫА
Ђ»@.Иm`°Ца"hЂАЂЄ°Ђ
ааh@ 1 €—я00`kYё@  Ўђ1`Ѕ 
й v ^ § Ћ
4p
°[P0уРђИ ПР
¶р ж0‰zсpЦp
2`
®
¦Z@aА
1P
Ађx
v
p@ 6 ° 0ї
MА  @/Е  ЕР J
 ` Р 
P ј @ №°U0
ZP 0р
щЯ0°( 2р |РP˜†Y“А
А
< !…°sАlђydp fА
Ф'яРy0°a+
$Ps` —iВ Ђ°™@Б0њu w0gА
`“""(P" њP =p"а- t@P <РРАОр
}АUРYP+PіР4cPc` М0.0Л°c
аџtQ…р`аl0ж­тJаs@sРЮP©`‡ѓИАПЂ
 E‡
`@n—ЈЈX ¦РD
sР 2=а
qа,p
Р° ђ@T
Р‰А
.p
`р
Ср
 
°и
ДА
Mp
SАlеpt@ЯР8яPA°F@ PА
1А
[… р Ђа
dРњр$0K0SҐ X` д@•А!А
0 U0;p ТР—ЫЈ`•А 0!
ђр
y@Т°
”Аљ
€р
0P }
P$Ї+@
° МПр Ђ` $А
!`
{ЛрЉ Ч 
sА Eр
mА
W@Ь`рR
У 
р t@И03аС 
0
pРдА ¶PЖUT`іРu m ` QG­ЂOИ 
 ,АФ
е eа(а
V
:А юА
Ѕ
СаMрNРpЦ<@да b]а
s@ ~` Р«Pр њђ}`
і`
їРУА
д
Г
гР¦PZ0©°
c
t
Ааp{ 
xpа0ЈрЋ±°
ьрО` ЅаBђЮ?РйЌ йэ
Х0fР °#ђЮ].BP ЇА А˜А°
'њЂ9jд`
аp v Ќя1m
р ђ>ЌБ
аpxаwА
Јp‡¬рЬА
C
wђр±ЬАS
Њ  )`
а Ы №Р _° Ґаrа˜4 
° µюZ`
щ
!@
Џ@S рw
EP ·ђ
ц0
I  0
ї@Р
D
4 ¬@ /р
0'`@мђ
>ЂФ"
oР ЩЂ з  ЉP Ц
­ђ
Є
p
:АгyАB №±P~
ЊА=С
,іћш“€Ь=BNhёAC (ШYксAМ FўвИ™vKЪяґ6|uпжЭЫчoЅ LЄҐиОЈGЃBu°
}
ґX'‰?RЂFЋ@@ ‰7$Шж$0¦WLYD™(щ $ККg@ ѓrHqАP@№ѓ›@Ih†a‰ЄшXX&cЂ‡Ђ6Ж
@sЁЂЃЌ`бЊ­LYaњ"о!!‚ё@‰d(с!“"tPBeІжTдQяe€J` Ѓ3<Q <аеЉ@jш…8Pав*<4f
1B˜В
t0`
6ЁШЎќDЁщ†ЏgJ@ 6.ЎА-БaЊ%
Ј6z®}jЙБ`д1Ęmр8г…Y  яf…Wћ &Ѓ_b1e 2FPАD
¶Шб™ 
n!з’-аDЊ'
еЋ_l0Еѓ= ѕ u¬8  N0AS qdSly+ВЉ¤Ђ{ўЂ
D c bІ "Ј„9~LьxдЌюbP,0EFE•'–Ѓд–*v ѓћ;Мia2€Б!¦ЁdD(бљ0
e`ђfX
8ЖР¤Ѓ!а@%fс ”#€@@z ЃЎђБpЊB„ ћ`ЃЌxД!=ўДp”"ОАexа E Ж+Ц
­hЗ˜P€2`г \@b!
йџ!`X0†Кtа
±˜%hMљА9`ГДp‰'рHE'А°‡Аb
® „ "°Ѓwь`
~0C>КЎ
(Gx ЃN В Rх„5 Ра
"U( №ђ :С<
0 и…"^Ў ~€
Ђ$8РЃаЃWГмА ]<ѓLБ ˜` Њ
f”АИа
еяиДнбЃFРб |@ѓЁn
д(@=BСуPХ6xСc<R06В€'Њ!G„ „`cJ Ѓ Ь$@,ЎеАѕ‰2аЂ;x…!†ђ ha ¶€F BаЏrр
$ђЂza‡JфтЇy¦µСm0Ђ$^а
@
˜ЎќШГь°‚<ўжАѓw|Ђ&
R
h„рЂ ˜,LрVh(CN4€KИЃё
' ?0˜† `ѓ/`„@Ѓ\$({@Ѓ9€Ђ& u`ЃР…. „w0.ёЂ9 /h„
h( Ѓal…U( Jh…hЃ~ …RёЃlё)`„
|\
P
рEАЂ#@9
Чђх|„(ёЃ8"0
Аt `d01€
ИђpЃ Ђ‡€†|
@:(h…wЂ( Z Ђ>xЃ2шytр.PЂFЂШртХЧGр0…i 'Ђ
Р
ё‡ 1°ѓ'PЂ*Ё0
@`
„fЂђ†‚с‰_`2@†ТѓX…  Ѓ#X6љЂW сиL`˜зFЂ
яE0upѓР$АЃD Ђ„ „"ЂBР* Sp
„#ptЂѓ;PЂ2Ѓ<˜*H
8
6р‡`РLg†ЂЁ
@
u
8
Pm`p7Ѓ0#[ш2 ПXRRш\а—вж‚+ЂјПH"PЂ9FЃ†?
В…JЂ АЋ 
ЁшЛ7G“¦B.в™dЌКааВ/n<рЄ+ЉdаТЎ]ђ
gшC3EМPуѓУ„Г `# TТA
$P„ґ\`„5Ё‘† ®@ЃЌ0pБЪ ’ I*№$—Ђ0Л(pR
E€РB еlpАЮМаЋ<'ґбя"'Р0M$ю„БWґAТ@аВ '€a#] 4ЁpN2Р Б & 
N0№(ЈЌ:ЉУ"Є\I$dаВ.ZXbИ¶ґЈD2±˜°ВЂE  ‰&0Б:RXЃИишИАA1@(sИ.GЎC. уЩЈН:ымЈ&„С@ ІфЃdЂJpМќЇ€`EЫ0 O;|G„ С”ЎН93МО:-P r4ЂЕ $Т@0Ь 'Мa
P,ґ
рqQМс9а|1J.$XвЌiD°A»ґPH A@Ѓ€ ш@яЃ §@,мв†(*Ё` “HЃ Т,°@
JђЋ=dBГ
oXcОИ06&атI&I
А
ї|аЊ+ёИАC`"DxQЂ |ђ‰”ф°Ж˜
» ‚Ё'Б >+«8ґpЂ
b)
EёГ$о„"ЈА1ёa‡QЬAxPЕ2Fq‰}}Ба€.ЎЗ¤
 Ж%BЎ‡P 
ърЂЭѓ)2І

F
hCLЁAЂ„fp!l C PРЊHьЃ3ЄРќ€!
(ђCp
n(Ж:20
A*$p
њў|HА€JА
Mа «h<NЋ Ѓ hяfѕ9`<B Ѓ
-@"RX*.Ђk "#“ 0ђ™©ЃOhcЕAL
€@„&pmh`±ИГ5` ‰-˜!C`Бм@Њ_
dя0†1Шч C,
ЊЎЬИБ€aѓ˜ў|ЂC
~ЃЋ hC
€‚%ШЃЂ \`x3”!‰Ь" dH
(S&бЃшўиX@! ЂpЂCHВ^у0АX˜>PRя+ь@ БЖаѓ<Ђ`Њ@Б< ЌА,FэJЂ т.ы‡µГџhВJ љ`З
&і
А
¬‚`°ь­ ЈђБ
М
А
x>ША° 2 A ЬPH@Д
x@"8А$`@FЊCB8ђГ.0Bь
Њ Th
ЊЃ1Г-ШБ0м
?ЊA
d l0А A
њАѓ> ]P4В*Вs.Ё^БXА0@PAаЁГ Ёѓ Ф@
иВ4t@ H
@$(@B @
 А6DБА§SqAЊH

ША5№БЁВАџЮкL€B
АCјp5ЃHA˜
pЃ?„?,
pT TЃ@П.мL 
tА"#(B
8
Ђ@,ё@3јAH
Ђ(Ю€
†C”Б
ђ88@3€ББѕ  я‚
рC- ВDA0В4C
Tпт®ЬБ5@ 4Ачto

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 814 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,15 @@
<?php
session_start();
if (!($_SESSION['uid'] > 0)) header("Location: index.php");
include "config.php";
include "functions.php";
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
if ($user['room'] == 403) {
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
require_once "functions.php";
$user = new User($_SESSION['uid']);
if ($user->room == 403) {
include "startpodzemel.php";
if ($user['battle'] != 0) { header('location: fbattle.php'); die(); }
if ($user->battle != 0) { header('location: fbattle.php'); die(); }
if($_GET['act']=="cexit")
{
@ -49,6 +50,14 @@ mysql_query("UPDATE `users`,`online` SET `users`.`room` = '402',`online`.`room`
print "<script>location.href='vxod.php'</script>"; exit();
}
function podzem_brat() {
$frt=mysql_query("select user_id from `labirint` where glava='".$glava."'");
while($rbb=mysql_fetch_array($frt)){
addchp ('<b>'.$user->login.'</b> поднял предмет "'.$mis.'". ','{[]}'.Nick::id($rbb["user_id"])->short().'{[]}');
}
}
}
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="ru">
@ -206,7 +215,7 @@ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner=
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Чистая гайка','1','g_c.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis = "Чистая гайка";
include "podzem_brat.php";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Чистая гайка'</span>";
}else{if($stloc==''){print"&nbsp;<span class='error'>Кто-то оказался быстрее!</span>";}}
}
@ -228,7 +237,7 @@ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1, massa=massa+0.1 WHERE owner
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis = "Гайка";
include "podzem_brat.php";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Гайка'</span>";
}else{if($stloc==''){print"&nbsp;<span class='error'>Кто-то оказался быстрее!</span>";}}
}
@ -251,7 +260,7 @@ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.2 WHERE owner=
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Вентиль','1','v.gif','".$user['id']."','200','0.2','0','Лука')");
}
$mis = "Вентиль";
include "podzem_brat.php";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Вентиль'</span>";
}else{if($stloc==''){print"&nbsp;<span class='error'>Кто-то оказался быстрее!</span>";}}
}
@ -273,7 +282,7 @@ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.4 WHERE owner=
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Чистый вентиль','1','v2.gif','".$user['id']."','200','0.4','0','Лука')");
}
$mis = "Чистый вентиль";
include "podzem_brat.php";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Чистый вентиль'</span>";
}else{if($stloc==''){print"&nbsp;<span class='error'>Кто-то оказался быстрее!</span>";}}
}
@ -295,7 +304,7 @@ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner=
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Болт','1','bolt.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis = "Болт";
include "podzem_brat.php";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Болт'</span>";
}else{if($stloc==''){print"&nbsp;<span class='error'>Кто-то оказался быстрее!</span>";}}
}
@ -317,7 +326,7 @@ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.2 WHERE owner=
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Длинный болт','1','dbolt.gif','".$user['id']."','200','0.2','0','Лука')");
}
$mis = "Длинный болт";
include "podzem_brat.php";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Длинный болт'</span>";
}else{if($stloc==''){print"&nbsp;<span class='error'>Кто-то оказался быстрее!</span>";}}
}
@ -331,7 +340,7 @@ if($stloc=='510'){
if($stloc=='510'){mysql_query("UPDATE `podzem3` SET n$mesto='' WHERE glava='$glava' and name='".$mir['name']."'");}
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Ключиик','1','kluchik.gif','".$user['id']."','200','0.5','0','Лука')");
$mis = "Ключиик";
include "podzem_brat.php";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Ключиик'</span>";
}else{if($stloc==''){print"&nbsp;<span class='error'>Кто-то оказался быстрее!</span>";}}
}
@ -356,7 +365,7 @@ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner=
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis = "Гайка";
include "podzem_brat.php";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Гайка'</span>";
}
}else{if($stloc=='13.0'){print"&nbsp;<span class='error'>Кто-то оказался быстрее!</span>";}}
@ -382,7 +391,7 @@ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner=
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Болт','1','bolt.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis = "Болт";
include "podzem_brat.php";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Болт'</span>";
}
}else{if($stloc=='14.0'){print"&nbsp;<span class='error'>Кто-то оказался быстрее!</span>";}}
@ -427,7 +436,7 @@ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner=
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis = "Гайка";
include "podzem_brat.php";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Гайка'</span>";
}
}else{if($stloc=='11.0'){print"&nbsp;<span class='error'>Попахивает...</span>";}}
@ -457,7 +466,7 @@ mysql_query("UPDATE `inventory` SET maxdur=maxdur+1,massa=massa+0.1 WHERE owner=
$fo = mysql_query("INSERT INTO `inventory`(name,maxdur,img,owner,type,massa,isrep,present) VALUES('Гайка','1','g.gif','".$user['id']."','200','0.1','0','Лука')");
}
$mis = "Гайка";
include "podzem_brat.php";
podzem_brat();
print"&nbsp;<span class='success'>Вы получили 'Гайка'</span>";
}
}else{if($stloc=='12.0'){print"&nbsp;<span class='error'>Попахивает...</span>";}}

View File

@ -124,12 +124,22 @@ if ($user['room'] == 403) {
}
$s = '';
if (!$step4['left']) {$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/ln4.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';}
if ($step4['left']) {$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/ly4.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';}
if ($step4['right']) {$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/ry4.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';}
if (!$step4['right']) {$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/rn4.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';}
if (!$step4['left']) {
$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/ln4.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';
}
if ($step4['left']) {
$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/ly4.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';
}
if ($step4['right']) {
$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/ry4.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';
}
if (!$step4['right']) {
$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/rn4.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';
}
if (!$step3['right']) {$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/rn3.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';}
if (!$step3['right']) {
$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/rn3.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';
}
if ($step3['right']) {
$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/ry3.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';
}
@ -146,8 +156,12 @@ if ($user['room'] == 403) {
if ($step2['right']) {
$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/ry2.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';
}
if ($step2['left']) {$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/ly2.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';}
if (!$step2['left']) {$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/ln2.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';}
if ($step2['left']) {
$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/ly2.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';
}
if (!$step2['left']) {
$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/ln2.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';
}
if (!$step1['right']) {
$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/rn1.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';
@ -163,12 +177,487 @@ if ($user['room'] == 403) {
}
///////stenq////////
if (!$step4['fwd']) {$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/cy3.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';}
if (!$step3['fwd']) {$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/cn3.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';}
if (!$step2['fwd']) {$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/cn2.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';}
if (!$step1['fwd']) {$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/cn1.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';}
if (!$step4['fwd']) {
$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/cy3.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';
}
if (!$step3['fwd']) {
$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/cn3.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';
}
if (!$step2['fwd']) {
$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/cn2.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';
}
if (!$step1['fwd']) {
$s .= '<div style="position:absolute; left:11px; top:10px;"><img src="labirint3/' . $styles . '/cn1.gif" width="352" height="240" title="Этаж 1 - Канализация"></div>';
}
include "podzem_mod.php";
$rs = mysql_query("select * from labirint where user_id='" . $_SESSION['uid'] . "'");
$t = mysql_fetch_array($rs);
/*
///Удаляем убитых ботов с локации
// Узнаем номер ледующей локи(где проводилась зачистка)
$apol = mysql_fetch_array(mysql_query("SELECT * FROM `labirint` WHERE glava='$glava' and name='".$t['name']."'"));
$comment1 = "лабиринт".$apol['boi'];
//Ищем бой, проверяем кто победил
$apol1 = mysql_fetch_array(mysql_query("SELECT * FROM `battle` WHERE coment='{$comment1}' and timeout='3'"));
//Если победил мобов, то убираем их из таблицы лабиринт
if($apol1['win']=='1') {
mysql_query("UPDATE podzem3 SET `n".$apol['boi']."` = '' WHERE glava = '{$glava}' LIMIT 2");
} */
$f = mysql_query("SELECT * FROM podzem3 WHERE glava='$glava' and name='" . $t['name'] . "'");
while ($rt = mysql_fetch_array($f)) {
if ($vector == '0') {
$loc4 = $location + 30;
}
if ($vector == '0') {
$loc3 = $location + 20;
}
if ($vector == '0') {
$loc2 = $location + 10;
}
if ($vector == '180') {
$loc4 = $location - 30;
}
if ($vector == '180') {
$loc3 = $location - 20;
}
if ($vector == '180') {
$loc2 = $location - 10;
}
if ($vector == '90') {
$loc4 = $location + 3;
}
if ($vector == '90') {
$loc3 = $location + 2;
}
if ($vector == '90') {
$loc2 = $location + 1;
}
if ($vector == '270') {
$loc4 = $location - 3;
}
if ($vector == '270') {
$loc3 = $location - 2;
}
if ($vector == '270') {
$loc2 = $location - 1;
}
$mesto = $location;
if ($location == '01') {
$mesto = '1';
}
if ($location == '02') {
$mesto = '2';
}
if ($location == '03') {
$mesto = '3';
}
if ($location == '04') {
$mesto = '4';
}
if ($location == '05') {
$mesto = '5';
}
if ($location == '06') {
$mesto = '6';
}
if ($location == '07') {
$mesto = '7';
}
if ($location == '08') {
$mesto = '8';
}
if ($location == '09') {
$mesto = '9';
}
include "podzem/raschet_bot.php";
////////////////////////////////////////////////
$fd = mysql_query("SELECT * FROM podzem4 WHERE glava='$glava' and name='" . $t['name'] . "'");
$repa = mysql_fetch_array($fd);
//////////////Объекты////////////////
if ($repa["n$mesto"] == '20') {
mysql_query("UPDATE `users`,`online` SET `users`.`room` = '404',`online`.`room` = '404' WHERE `online`.`id` = `users`.`id` AND `online`.`id` = '{$_SESSION['uid']}' ;");
print "<script>location.href='main.php?act=none'</script>";
exit;
}
///////
//Вход на 2ой этаж
if ($repa["n$loc2"] == 'et2' and $vector == $repa["v$loc2"]) {
$s .= '<div style="position:absolute; left:150px; top:165px;"><a href="?act=et2"><img src="labirint3/stok.gif" width="65" border="0" height="15" title="Спуск на нижний ярус"></a></div>';
}
//Вход на 1ый этаж
if ($repa["n$loc2"] == 'et1' and $vector == $repa["v$loc2"]) {
$s .= '<div style="position:absolute; left:150px; top:50px;"><a href="?act=et1"><img src="labirint3/lestnica.gif" width="65" border="0" height="120" title="Подъем на верхний ярус"></a></div>';
}
if ($repa["n$loc2"] == '20' and $vector == $repa["v$loc2"]) {
$s .= '<div style="position:absolute; left:60px; top:34px;"><img src="labirint3/sclad.gif" width="255" border="0" height="172" alt="Бывший скад мартына."></div>';
}
if ($repa["n$loc3"] == '20' and $vector == $repa["v$loc3"]) {
$s .= '<div style="position:absolute; left:107px; top:55px;"><img src="labirint3/sclad2.jpg" width="162" border="0" height="110" alt="Бывший скад мартына."></div>';
}
if ($repa["n$loc4"] == '20' and $vector == $repa["v$loc4"]) {
$s .= '<div style="position:absolute; left:130px; top:66px;"><img src="labirint3/sclad3.jpg" width="117" border="0" height="80" alt="Бывший скад мартына."></div>';
}
if ($repa["n$loc2"] == 'el' and $vector == $repa["v$loc2"]) {
$s .= '<div style="position:absolute; left:150px; top:115px;"><a href="?act=el"><img src="labirint3/zel.gif" width="80" border="0" height="80" alt="Зелье"></a></div>';
}
if ($repa["n$loc3"] == 'el' and $vector == $repa["v$loc3"]) {
$s .= '<div style="position:absolute; left:165px; top:115px;"><img src="labirint3/zel.gif" width="50" border="0" height="50" alt="Зелье"></div>';
}
if (($repa["n$mesto"] == '11.1' or $repa["n$mesto"] == '11.0') and $vector == $repa["v$mesto"]) {
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:180px; top:165px;"><img src="labirint3/1/kanal.gif" width="40" height="40" border="0" alt="Водосток" style="CURSOR:pointer;" onClick="stok(' . $mesto . ');"></div>';
}
if (($repa["n$loc2"] == '11.1' or $repa["n$loc2"] == '11.0') and $vector == $repa["v$loc2"]) {
$s .= '<div style="position:absolute; left:180px; top:140px;"><img src="labirint3/1/kanal.gif" width="25" height="25" border="0" alt="Водосток"></div>';
}
if (($repa["n$loc3"] == '11.1' or $repa["n$loc3"] == '11.0') and $vector == $repa["v$loc3"]) {
$s .= '<div style="position:absolute; left:182px; top:130px;"><img src="labirint3/1/kanal.gif" width="15" height="15" border="0" alt="Водосток"></div>';
}
if (($repa["n$loc4"] == '11.1' or $repa["n$loc4"] == '11.0') and $vector == $repa["v$loc4"]) {
$s .= '<div style="position:absolute; left:182px; top:125px;"><img src="labirint3/1/kanal.gif" width="10" height="10" border="0" alt="Водосток"></div>';
}
/////////////
if (($repa["n$loc2"] == '12.1' or $repa["n$loc2"] == '12.0') and $vector == $repa["v$loc2"]) {
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:160px; top:170px;"><img src="labirint3/1/stok.gif" width="60" height="15" border="0" alt="Водосток" style="CURSOR:pointer;" onClick="stok2(' . $loc2 . ');"></div>';
}
if (($repa["n$loc3"] == '12.1' or $repa["n$loc3"] == '12.0') and $vector == $repa["v$loc3"]) {
$s .= '<div style="position:absolute; left:175px; top:150px;"><img src="labirint3/1/stok.gif" width="40" height="8" border="0" alt="Водосток"></div>';
}
if (($repa["n$loc4"] == '12.1' or $repa["n$loc4"] == '12.0') and $vector == $repa["v$loc4"]) {
$s .= '<div style="position:absolute; left:178px; top:138px;"><img src="labirint3/1/stok.gif" width="20" height="5" border="0" alt="Водосток"></div>';
}
////////////////klju4i/////////////////////////
if ($repa["n$mesto"] == 'key1' or $repa["n$loc2"] == 'key1' or $repa["n$loc3"] == 'key1' or $repa["n$loc4"] == 'key1') {
$nomers = '1';
}
if ($repa["n$mesto"] == 'key2' or $repa["n$loc2"] == 'key2' or $repa["n$loc3"] == 'key2' or $repa["n$loc4"] == 'key2') {
$nomers = '2';
}
if ($repa["n$mesto"] == 'key3' or $repa["n$loc2"] == 'key3' or $repa["n$loc3"] == 'key3' or $repa["n$loc4"] == 'key3') {
$nomers = '3';
}
if ($repa["n$mesto"] == 'key4' or $repa["n$loc2"] == 'key4' or $repa["n$loc3"] == 'key4' or $repa["n$loc4"] == 'key4') {
$nomers = '4';
}
if ($repa["n$mesto"] == 'key5' or $repa["n$loc2"] == 'key5' or $repa["n$loc3"] == 'key5' or $repa["n$loc4"] == 'key5') {
$nomers = '5';
}
if ($repa["n$mesto"] == 'key6' or $repa["n$loc2"] == 'key6' or $repa["n$loc3"] == 'key6' or $repa["n$loc4"] == 'key6') {
$nomers = '6';
}
if ($repa["n$mesto"] == 'key7' or $repa["n$loc2"] == 'key7' or $repa["n$loc3"] == 'key7' or $repa["n$loc4"] == 'key7') {
$nomers = '7';
}
if ($repa["n$mesto"] == 'key8' or $repa["n$loc2"] == 'key8' or $repa["n$loc3"] == 'key8' or $repa["n$loc4"] == 'key8') {
$nomers = '8';
}
if ($repa["n$mesto"] == 'key9' or $repa["n$loc2"] == 'key9' or $repa["n$loc3"] == 'key9' or $repa["n$loc4"] == 'key9') {
$nomers = '9';
}
if ($repa["n$mesto"] == 'key10' or $repa["n$loc2"] == 'key10' or $repa["n$loc3"] == 'key10' or $repa["n$loc4"] == 'key10') {
$nomers = '10';
}
if (($repa["n$mesto"] == 'key1' or $repa["n$mesto"] == 'key2' or $repa["n$mesto"] == 'key3' or $repa["n$mesto"] == 'key4' or $repa["n$mesto"] == 'key5' or $repa["n$mesto"] == 'key6' or $repa["n$mesto"] == 'key7' or $repa["n$mesto"] == 'key8' or $repa["n$mesto"] == 'key9' or $repa["n$mesto"] == 'key10') and $vector == $repa["v$mesto"]) {
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:160px; top:165px;"><img src="labirint3/' . $repa["n$mesto"] . '.gif" width="60" height="60" border="0" alt="Ключ №' . $nomers . '" style="CURSOR:pointer;" onClick="key(' . $mesto . ',' . $nomers . ');"></div>';
}
if (($repa["n$loc2"] == 'key1' or $repa["n$loc2"] == 'key2' or $repa["n$loc2"] == 'key3' or $repa["n$loc2"] == 'key4' or $repa["n$loc2"] == 'key5' or $repa["n$loc2"] == 'key6' or $repa["n$loc2"] == 'key7' or $repa["n$loc2"] == 'key8' or $repa["n$loc2"] == 'key9' or $repa["n$loc2"] == 'key10') and $vector == $repa["v$loc2"]) {
$s .= '<div style="position:absolute; left:175px; top:140px;"><img src="labirint3/' . $repa["n$loc2"] . '.gif" width="40" height="40" border="0" alt="Ключ №' . $nomers . '"></div>';
}
if ($step2['fwd'] and ($repa["n$loc3"] == 'key1' or $repa["n$loc3"] == 'key2' or $repa["n$loc3"] == 'key3' or $repa["n$loc3"] == 'key4' or $repa["n$loc3"] == 'key5' or $repa["n$loc3"] == 'key6' or $repa["n$loc3"] == 'key7' or $repa["n$loc3"] == 'key8' or $repa["n$loc3"] == 'key9' or $repa["n$loc3"] == 'key10') and $vector == $repa["v$loc3"]) {
$s .= '<div style="position:absolute; left:175px; top:130px;"><img src="labirint3/' . $repa["n$loc3"] . '.gif" width="25" height="25" border="0" alt="Ключ №' . $nomers . '"></div>';
}
if ($step3['fwd'] and ($repa["n$loc4"] == 'key1' or $repa["n$loc4"] == 'key2' or $repa["n$loc4"] == 'key3' or $repa["n$loc4"] == 'key4' or $repa["n$loc4"] == 'key5' or $repa["n$loc4"] == 'key6' or $repa["n$loc4"] == 'key7' or $repa["n$loc4"] == 'key8' or $repa["n$loc4"] == 'key9' or $repa["n$loc4"] == 'key10') and $vector == $repa["v$loc4"]) {
$s .= '<div style="position:absolute; left:182px; top:125px;"><img src="labirint3/' . $repa["n$loc4"] . '.gif" width="15" height="15" border="0" alt="Ключ №' . $nomers . '"></div>';
}
if ($step3['fwd'] and ($repa["n$loc4"] == '13.1' or $repa["n$loc4"] == '13.0')) {
$s .= '<div style="position:absolute; left:178px; top:120px;"><img src="labirint3/sun.gif" width="25" height="25" border="0" alt="Сундук"></div>';
}
if ($step3['fwd'] and ($repa["n$loc4"] == '14.1' or $repa["n$loc4"] == '14.0')) {
$s .= '<div style="position:absolute; left:178px; top:120px;"><img src="labirint3/2.gif" width="25" height="25" border="0" alt="Сундук"></div>';
}
//////////////////////3/////////////////////////
if ($step3['fwd'] and $rt["n$loc4"] != '') {
if ($k_b == '1') {
$s .= '<div style="position:absolute; left:165px; top:65px;"><img src="labirint3/' . $ob . '.gif" width="50" height="85" title=' . $b_n . '></div>';
}
if ($k_b == '2') {
$s .= '<div style="position:absolute; left:140px; top:65px;"><img src="labirint3/' . $ob . '.gif" width="50" height="85" title=' . $b_n . '></div>';
$s .= '<div style="position:absolute; left:190px; top:65px;"><img src="labirint3/' . $ob2 . '.gif" width="50" height="85" title=' . $b_n2 . '></div>';
}
if ($k_b == '3') {
$s .= '<div style="position:absolute; left:135px; top:70px;"><img src="labirint3/' . $ob . '.gif" width="50" height="80" title=' . $b_n . '></div>';
$s .= '<div style="position:absolute; left:190px; top:70px;"><img src="labirint3/' . $ob3 . '.gif" width="50" height="80" title=' . $b_n3 . '></div>';
$s .= '<div style="position:absolute; left:165px; top:80px;"><img src="labirint3/' . $ob2 . '.gif" width="50" height="80" title=' . $b_n2 . '></div>';
}
}
$rogs = mysql_query("SELECT login,location FROM `labirint` WHERE `glava`='$glava'");
$i = 0;
while ($mores = mysql_fetch_array($rogs)) {
$i++;
$nus = mysql_num_rows($rogs);
if ($vector == 0) {
$lac = $location + 30;
}
if ($vector == 90) {
$lac = $location + 3;
}
if ($vector == 180) {
$lac = $location - 30;
}
if ($vector == 270) {
$lac = $location - 3;
}
if ($step3['fwd'] and $lac == $mores['location'] and $nus >= 2) {
if ($nus == 2) {
$l = '170';
}
if ($nus == 3) {
if ($i == 1) {
$l = '140';
}
if ($i == 2) {
$l = '170';
}
if ($i == 3) {
$l = '200';
}
}
if ($nus == 4) {
if ($i == 1) {
$l = '140';
}
if ($i == 2) {
$l = '160';
}
if ($i == 3) {
$l = '180';
}
if ($i == 4) {
$l = '200';
}
}
$s .= '<div style="position:absolute; left:' . $l . 'px; top:70px;"><img src="labirint3/0.gif" width="35" height="75" title=' . $mores['login'] . '></div>';
}
}
if ($step3['fwd'] and $repa["n$loc4"] >= '1' and $repa["n$loc4"] <= '10') {
$s .= '<div style="position:absolute; left:124px; top:66px;"><img src="labirint3/rewet.gif" width="122" border="0" height="82" alt="Решетка(нужен ключ №' . $repa["n$loc4"] . ')"></div>';
}
/////////////////////////////////////////////
if ($step2['fwd'] and ($repa["n$loc3"] == '13.1' or $repa["n$loc3"] == '13.0')) {
$s .= '<div style="position:absolute; left:170px; top:120px;"><img src="labirint3/sun.gif" width="40" height="40" border="0" alt="Сундук"></div>';
}
if ($step2['fwd'] and ($repa["n$loc3"] == '14.1' or $repa["n$loc3"] == '14.0')) {
$s .= '<div style="position:absolute; left:170px; top:120px;"><img src="labirint3/2.gif" width="40" height="40" border="0" alt="Сундук"></div>';
}
/////////////////////2///////////////////////
if ($step2['fwd'] and $rt["n$loc3"] != '') {
if ($k_b3 == '1') {
$s .= '<div style="position:absolute; left:155px; top:60px;"><img src="labirint3/' . $ob3 . '.gif" width="65" height="110" title=' . $b_n3 . '></div>';
}
if ($k_b3 == '2') {
$s .= '<div style="position:absolute; left:120px; top:60px;"><img src="labirint3/' . $ob3 . '.gif" width="65" height="110" title=' . $b_n3 . '></div>';
$s .= '<div style="position:absolute; left:185px; top:60px;"><img src="labirint3/' . $ob32 . '.gif" width="65" height="110" title=' . $b_n32 . '></div>';
}
if ($k_b3 == '3') {
$s .= '<div style="position:absolute; left:115px; top:60px;"><img src="labirint3/' . $ob3 . '.gif" width="65" height="110" title=' . $b_n3 . '></div>';
$s .= '<div style="position:absolute; left:190px; top:60px;"><img src="labirint3/' . $ob33 . '.gif" width="65" height="110" title=' . $b_n33 . '></div>';
$s .= '<div style="position:absolute; left:155px; top:70px;"><img src="labirint3/' . $ob32 . '.gif" width="65" height="110" title=' . $b_n32 . '></div>';
}
}
$rogs = mysql_query("SELECT login,location FROM `labirint` WHERE `glava`='$glava'");
$i = 0;
while ($mores = mysql_fetch_array($rogs)) {
$i++;
$nus = mysql_num_rows($rogs);
if ($vector == 0) {
$lac = $location + 20;
}
if ($vector == 90) {
$lac = $location + 2;
}
if ($vector == 180) {
$lac = $location - 20;
}
if ($vector == 270) {
$lac = $location - 2;
}
if ($step2['fwd'] and $lac == $mores['location'] and $nus >= 2) {
if ($nus == 2) {
$l = '160';
}
if ($nus == 3) {
if ($i == 1) {
$l = '130';
}
if ($i == 2) {
$l = '160';
}
if ($i == 3) {
$l = '190';
}
}
if ($nus == 4) {
if ($i == 1) {
$l = '120';
}
if ($i == 2) {
$l = '150';
}
if ($i == 3) {
$l = '180';
}
if ($i == 4) {
$l = '210';
}
}
$s .= '<div style="position:absolute; left:' . $l . 'px; top:50px;"><img src="labirint3/0.gif" width="50" height="110" title=' . $mores['login'] . '></div>';
}
}
if ($step2['fwd'] and $repa["n$loc3"] >= '1' and $repa["n$loc3"] <= '10') {
$s .= '<div style="position:absolute; left:103px; top:50px;"><img src="labirint3/rewet.gif" width="172" border="0" height="120" alt="Решетка(нужен ключ №' . $repa["n$loc3"] . ')"></div>';
$s .= '<div style="position:absolute; left:124px; top:66px;"><img src="labirint3/rewet.gif" width="122" border="0" height="82" alt="Решетка(нужен ключ №' . $repa["n$loc3"] . ')"></div>';
}
///////////////////////////////////////////
if ($step1['fwd'] and ($repa["n$loc2"] == '13.1' or $repa["n$loc2"] == '13.0')) {
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:155px; top:130px;"><img src="labirint3/sun.gif" width="60" height="60" border="0" alt="Сундук" style="CURSOR:pointer;" onClick="sunduk(' . $loc2 . ');"></div>';
}
if ($step1['fwd'] and ($repa["n$loc2"] == '14.1' or $repa["n$loc2"] == '14.0')) {
$s .= '<div onmouseout="closeMenu();" style="position:absolute; left:155px; top:130px;"><img src="labirint3/2.gif" width="60" height="60" border="0" alt="Сундук" style="CURSOR:pointer;" onClick="sunduk2(' . $loc2 . ');"></div>';
}
/////////////////////1/////////////////////
if ($step1['fwd'] and $rt["n$loc2"] != '') {
if ($k_b2 == '1') {
if ($rt["n$loc2"] == '8') {
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:135px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="Opendialog(' . $loc2 . ',event);"></div>';
} else {
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:135px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event);"></div>';
}
}
if ($k_b2 == '2') {
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:90px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event);"></div>';
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:180px; top:40px;"><img src="labirint3/' . $ob22 . '.gif" width="100" height="160" title=' . $b_n22 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event);"></div>';
}
if ($k_b2 == '3') {
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:80px; top:40px;"><img src="labirint3/' . $ob2 . '.gif" width="100" height="160" title=' . $b_n2 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event);"></div>';
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:195px; top:40px;"><img src="labirint3/' . $ob23 . '.gif" width="100" height="160" title=' . $b_n23 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event);"></div>';
$s .= '<div onmouseover="closeMenu();" style="position:absolute; left:140px; top:60px;"><img src="labirint3/' . $ob22 . '.gif" width="100" height="160" title=' . $b_n22 . ' style="CURSOR:pointer;" onClick="OpenMenu(' . $loc2 . ',event);"></div>';
}
}
$rogs = mysql_query("SELECT login,location FROM `labirint` WHERE `glava`='$glava'");
$i = 0;
while ($mores = mysql_fetch_array($rogs)) {
$i++;
$nus = mysql_num_rows($rogs);
if ($vector == 0) {
$lac = $location + 10;
}
if ($vector == 90) {
$lac = $location + 1;
}
if ($vector == 180) {
$lac = $location - 10;
}
if ($vector == 270) {
$lac = $location - 1;
}
if ($step1['fwd'] and $lac == $mores['location'] and $nus >= 2) {
if ($nus == 2) {
$l = '150';
}
if ($nus == 3) {
if ($i == 1) {
$l = '90';
}
if ($i == 2) {
$l = '150';
}
if ($i == 3) {
$l = '180';
}
}
if ($nus == 4) {
if ($i == 1) {
$l = '100';
}
if ($i == 2) {
$l = '140';
}
if ($i == 3) {
$l = '180';
}
if ($i == 4) {
$l = '210';
}
}
$s .= '<div style="position:absolute; left:' . $l . 'px; top:40px;"><img src="labirint3/0.gif" width="75" height="160" title=' . $mores['login'] . '></div>';
}
}
////////////////////////////////////////
if ($step1['fwd'] and $repa["n$loc2"] >= '1' and $repa["n$loc2"] <= '10') {
$s .= '<div style="position:absolute; left:50px; top:31px;"><img src="labirint3/rewet.gif" width="265" border="0" height="180" alt="Решетка(нужен ключ №' . $repa["n$loc2"] . ')"></div>';
$s .= '<div style="position:absolute; left:103px; top:50px;"><img src="labirint3/rewet.gif" width="172" border="0" height="120" alt="Решетка(нужен ключ №' . $repa["n$loc2"] . ')"></div>';
}
$mesto = $location;
if ($location == '01') {
$mesto = '1';
}
if ($location == '02') {
$mesto = '2';
}
if ($location == '03') {
$mesto = '3';
}
if ($location == '04') {
$mesto = '4';
}
if ($location == '05') {
$mesto = '5';
}
if ($location == '06') {
$mesto = '6';
}
if ($location == '07') {
$mesto = '7';
}
if ($location == '08') {
$mesto = '8';
}
if ($location == '09') {
$mesto = '9';
}
//////////////0-ja////////////////
if ($step1['fwd'] and $repa["n$mesto"] >= '1' and $repa["n$mesto"] <= '10') {
$s .= '<div style="position:absolute; left:55px; top:31px;"><img src="labirint3/rewet.gif" width="265" border="0" height="180" alt="Решетка(нужен ключ №' . $repa["n$mesto"] . ')"></div>';
}
}
return $s;
}

View File

@ -7,16 +7,6 @@ if (empty($_SESSION['uid'])) {
require_once 'functions.php';
//require_once 'cave/cave_bots.php';
class Cave
{
use CaveBots, CaveItems;
public static function cancarry($m, $user)
{
}
}
function cancarry($m, $u)
{
global $user;
@ -297,7 +287,7 @@ function takeusage($x, $y)
function makedeath()
{
global $user, $floor, $loses, $x, $y, $dir;
include("cavedata.php");
$cavedata = Config::$cavedata ?? [];
if (!isset($cavedata[$user['room']]['x' . $floor])) {
$floor = 1;
loadmap();
@ -753,7 +743,7 @@ if ($ambushes[$y * 2][$x * 2 - 2] && $map[$y * 2][$x * 2 - 1] == 0) {
}
if ($ax && $ay && $user['hp'] > 0) {
include_once("cavedata.php");
$cavedata = Config::$cavedata ?? [];
if (!($cavedata[$user['room']]['x' . $floor] == $x && $cavedata[$user['room']]['y' . $floor] == $y)) {
if ($ax < $x) {
$dir1 = 0;

View File

@ -1,4 +0,0 @@
<?php
$cavedata = array(621 => array('x1' => 6, 'y1' => 11, 'dir1' => 1, 'x2' => 10, 'y2' => 8, 'dir2' => 1, 'x3' => 20, 'y3' => 4, 'dir3' => 1,'x4' => 10, 'y4' => 10, 'dir4' => 1, 'delay' => 360, 'name1' => 'Проклятый Рудник', 'name2' => 'Проклятого Рудника'));

27
ch.php

File diff suppressed because one or more lines are too long

View File

@ -8,11 +8,12 @@
session_start();
if (empty($_SESSION['uid'])) {
header("Location: index.php");
exit;
}
require_once "config.php";
//include_once "functions.php";
$msg = filter_input(INPUT_POST, 'msg');
$msg = $_POST['msg'] ?? null;
$uid = $_SESSION['uid'];
if ($msg) {
try { db::c()->query('INSERT INTO `chat` (`user_id`, `msg`) VALUES (?i, "?s")', $uid, $msg); }

View File

@ -1,429 +0,0 @@
<?php
//session_start();
ini_set("display_errors","1");
ini_set("display_startup_errors","1");
ini_set('error_reporting', E_ALL);
//if ($_SESSION['uid'] == null) header("Location: index.php");
include "config.php";
include "functions.php";
function vCode($LocID, $Stamp)
{
return md5(sha1($LocID . $Stamp));
}
$timeStamp = time();
$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1;"));
$thisChurch = 'none';
if( $user['align'] == 2 ) {
$thisChurch = 'default';
}
if( $user['align'] == 3 ) {
$thisChurch = 'dark';
}
if( $user['align'] == 7 ) {
$thisChurch = 'light';
}
$getChurch = mysql_fetch_assoc(mysql_query("SELECT * FROM `church_configs` WHERE `id`='" . $thisChurch . "'"));
$resChurch = unserialize($getChurch['data']);
if(isset($_GET['info'])){
$getResource = mysql_fetch_assoc(mysql_query("SELECT * FROM `shop` WHERE `id` = '" . intval($_GET['info']) . "' AND (type=80 or type=81 or type=82 or type=83 or type=84 or type=85 or type=86 or type=87 or type=89)"));
?>
<!DOCTYPE html>
<html>
<head>
<title><? ($getResource ? 'Храм Древних - ' . $getResource['name'] : 'Ошибка ресурса' ) ?></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="Cache-Control" Content="No-Cache">
<meta http-equiv="Pragma" Content="No-Cache">
<meta http-equiv="Expires" Content="0">
<link type="text/css" rel="stylesheet" href="css/main.css" />
<style type="text/css">
body {
margin: 5px;
}
</style>
</head>
<body>
<?
if($getResource){
$getRating = mysql_query("SELECT `uid`, SUM(`val`) as `val` FROM `church_logs` WHERE `key`='" . $getResource['id'] . "' AND `ch`='" . $thisChurch . "' GROUP BY `uid` ORDER BY SUM(`val`) DESC LIMIT 10;");
$ratingCount = mysql_num_rows($getRating);
echo'<table width="100%" height="100%" border="0" cellspacing="1" cellpadding="0">' .
'<tr>' .
'<td align="center" colspan="3">' . ($ratingCount > 0 ? 'Топ ' . $ratingCount . ', ' : '') . 'Материал: <b>' . $getResource['name'] . '</b></td>' .
'</tr>';
if($ratingCount > 0){
$i = 1;
while($row = mysql_fetch_assoc($getRating)){
echo'<tr>' .
'<td align="center" width="25" bgcolor="#' . ($row['uid'] != $user['id'] ? 'C0C0CA' : '999999') . '"><b>' . $i++ . '</b></td>' .
'<td align="center" bgcolor="#' . ($row['uid'] != $user['id'] ? 'C0C0CA' : '999999') . '">' . Nick::id($row['id'])->full(1) . '</td>' .
'<td align="center" bgcolor="#' . ($row['uid'] != $user['id'] ? 'C0C0CA' : '999999') . '"><b>' . $row['val'] . '</b> шт.</td>' .
'</tr>';
}
echo'<tr>' .
'<td align="center" colspan="3">&nbsp;</td>' .
'</tr>' .
'<tr>' .
'<td align="center" colspan="2" bgcolor="#C0C0CA">' . Nick::id($row['id'])->full(1) . '</td>' .
'<td align="center" bgcolor="#C0C0CA"><b>' . intval(mysql_result(mysql_query("SELECT SUM(`val`) as `val` FROM `church_logs` WHERE `key`='" . $getResource['id'] . "' AND `ch`='" . $thisChurch . "' AND `uid`='" . $user['id'] . "' GROUP BY `uid` ORDER BY SUM(`val`) DESC LIMIT 1;"), 0)) . '</b> шт.</td>' .
'</tr>';
}else{
echo '<tr>' .
'<td align="center" colspan="3">Нет данных</td>' .
'</tr>';
}
echo'</table>';
} else {
echo'<center>Ошибка ресурса</center>';
}
echo'</body>' .
'</html>';
exit;
}
?><HTML>
<HEAD>
<link rel="stylesheet" href="css/newstyle_loc4.css" type="text/css">
<link rel="stylesheet" type="text/css" href="css/main.css">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="0">
<META HTTP-EQUIV="imagetoolbar" CONTENT="no">
<style>
.aFilter:hover{
-webkit-filter:drop-shadow(0px 0px 2px rgb(255,255,255));
filter:url(#drop-shadow);
-ms-filter:"progid:DXImageTransform.Microsoft.Dropshadow(OffX=0, OffY=0, Color='#FFF')";
filter:"progid:DXImageTransform.Microsoft.Dropshadow(OffX=0, OffY=0, Color='#FFF')";
cursor:pointer;
}
</style>
<style type="text/css">img,div{behavior:url(/i/city/ie/iepngfix.htc)}</style>
<script type="text/javascript" src="/js/tooltip.js"></script>
<script type="text/javascript">
let timeStamp =;
function selecttarget(scrollid){
const targertinput = document.getElementById('target');
targertinput.value = scrollid;
const targetform = document.getElementById('formtarget');
targetform.submit();
}
function show_table(title, script){
let choicehtml = "<form style='display:none' id='formtarget' action='" + script + "' method=POST><input type='hidden' id='target' name='target'>";
choicehtml += "</form><table width='100%' cellspacing='1' cellpadding='0' bgcolor='CCC3AA'>";
choicehtml += "<tr><td align='center'><B>" + title + "</td>";
choicehtml += "<td width='20' align='right' valign='top' style='cursor: pointer' onclick='closehint3(true);'>";
choicehtml += "<big><b>x</td></tr><tr><td colspan='2' id='tditemcontainer'><div id='itemcontainer' style='width:100%'>";
choicehtml += "</div></td></tr></table>";
return choicehtml;
}
function showitemschoice(title, script,al){
$.get('itemschoice.php?get=1&svecha=qq&al='+al+'',function(data) {
const choicehtml = show_table(title, script);
const el = document.getElementById("hint3");
el.innerHTML = choicehtml+data;
el.style.width = 400 + 'px';
el.style.visibility = "visible";
el.style.left = 100 + 'px';
el.style.top = 100 + 'px';
Hint3Name = "target";
});
}
function closehint3(clearstored){
if(clearstored){
const targetform = document.getElementById('formtarget');
targetform.action += "&clearstored=1";
targetform.submit();
}
document.getElementById("hint3").style.visibility="hidden";
Hint3Name='';
}
function solo(id, vcode){
top.changeroom = id;
window.location.href = '?goto=' + id + '&tStamp=' + timeStamp + '&vcode=' + vcode;
}
function moveTo(id, file, vcode){
parent.changeroom = id;
window.location.href = file + '?goto=' + id + '&tStamp=' + timeStamp + '&vcode=' + vcode;
}
function imover(im){
im.filters.Glow.Enabled=true;
// im.style.visibility="hidden";
}
function imout(im){
im.filters.Glow.Enabled=false;
// im.style.visibility="visible";
}
function returned2(s){
location.href=''+s+'&tmp='+Math.random();
}
function showRating(id){
window.open('?info=' + id,'ratings','scrollbars=no,toolbar=no,status=no,resizable=yes,width=400,height=400')
}
function Down() {top.CtrlPress = window.event.ctrlKey}
document.onmousedown = Down;
</SCRIPT>
</HEAD>
<body leftmargin="5" topmargin="5" marginwidth="5" marginheight="5" bgcolor="#D7D7D7">
<script type="text/javascript">
$(document).ready(function() {
$('img[title]').mTip();
});
</script>
<div id=hint3 class=ahint style="z-index:150;"></div><?php
switch($_GET['got']){
case'level10':
echo'<div style="float: right;">
<input TYPE="button" value="Подсказка" style="background-color:#A9AFC0" onclick="window.open(\'help/hram.html\', \'help\', \'height=300,width=500,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes\')">
<input type="button" name="hram" onclick="window.location.href = \'?got=default\';" value="Вернуться">
</div><center><h1>Скоро тут все будет....</h1></center>';
break;
case'level11':
$Deposit = '';
if($_GET['wid']){
$getResource = mysql_fetch_assoc(mysql_query("SELECT * FROM `inventory` WHERE `id` = '" . intval($_GET['wid']) . "' AND `owner` = '{$_SESSION['uid']}' AND (type=80 or type=81 or type=82 or type=83 or type=84 or type=85 or type=86 or type=87 or type=89) AND `setsale` = '0'"));
if($getResource){
$userData = array();
// Выгружаем нащи данные
$getChUser = mysql_fetch_assoc(mysql_query("SELECT * FROM `church_users` WHERE `id` = '{$_SESSION['uid']}'"));
if($getChUser){
$userData = unserialize($getChUser['data']);
}
// Обновляем количество ресов в БД
$resChurch[$getResource['prototype']]['count'] += $getResource['koll'];
$userData[$getResource['prototype']] += $getResource['koll'];
mysql_query("REPLACE INTO `church_users` (`id`, `data`) VALUES ('{$_SESSION['uid']}', '" . serialize($userData) . "');");
mysql_query("UPDATE `church_configs` SET `data` = '" . serialize($resChurch) . "' WHERE `id`='" . $thisChurch . "'");
// Temp Data
$user['reputation'] += round($getResource['koll']*$getResource['repcost'], 2);
//Обнавляем нашу репу
mysql_query("UPDATE `users` SET `reputation`=`reputation`+'" . round($getResource['koll']*$getResource['repcost'], 2) . "',`doblest`=`doblest`+'" . round($getResource['koll']*$getResource['repcost'], 2) . "' WHERE `id`='{$_SESSION['uid']}'");
// Удаляем ресурсы
mysql_query("DELETE FROM `inventory` WHERE `id` = '" . $getResource['id'] . "'");
// Пишем логи
mysql_query("INSERT INTO `church_logs` (`ch`, `uid`, `key`, `val`) VALUES ('" . $thisChurch . "', '{$_SESSION['uid']}', '{$getResource['prototype']}', '{$getResource['koll']}');");
$Deposit = '<b>Вы пожертвовали на внутреннюю отделку: ' . $getResource['name'] . ' x' . $getResource['koll'] . ' </b><br>И получили ' . round($getResource['koll']*$getResource['repcost'], 2) . ' репутации.<br>';
}
}
$getResources = mysql_query("SELECT * FROM `inventory` WHERE `owner` = '{$_SESSION['uid']}' AND (type=80 or type=81 or type=82 or type=83 or type=84 or type=85 or type=86 or type=87 or type=89) AND `setsale` = 0 ORDER by `name` ASC; ");
$resources = '<b>К сожалению у Вас нет нужных ресурсов...</b>';
if (mysql_num_rows($getResources) > 0) {
$resources = '';
while($row = mysql_fetch_array($getResources)) {
$resources .= '<a href="?got=level11&wid=' . $row['id'] . ( isset($_GET['step']) ? '&step=true' : '' ) . '">Отдать ' . $row['name'] . ' x' . $row['koll'] . ' алтарю.</a><br />';
}
}
echo'<div style="float: right;">
<input TYPE="button" value="Подсказка" style="background-color:#A9AFC0" onclick="window.open(\'help/hram.html\', \'help\', \'height=300,width=500,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes\')">
<input type="button" name="hram" onclick="window.location.href = \'?got=default\';" value="Вернуться">
</div>
<style>
td a img {
background-color: #e2e0e0;
}
</style>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align=center valign=top>
<div style="color:#8F0000;font-weight:bold;font-size:16px;text-align:center;float:center;">Да пребудет с тобой сила, ' . $user['login'] . ', репутация: ' . $user['reputation'] . '</div>
</td>
</tr>
<tr>
<td align=center valign=top>
<br />' . $Deposit . $resources . '
</td>
</tr>
<tr>
<td align=center valign=top>';
if(isset($_GET['step'])){
echo'<table border="0" cellpadding=0 cellspacing=0 width="710" height="489" style="background:url(/i/sh/temle/bg.jpg) center no-repeat;">
<tr>
<td width="100%" height="70" colspan="9">&nbsp;</td>
</tr>
<tr>
<td width="190" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(501);"><img src="/i/sh/103001.gif" title="Название ресурса: <b>Мел</b><br />Собрано: <b>' . $resChurch['501']['count'] . '</b>"></a></td>
<td width="30" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(502);"><img src="/i/sh/103002.gif" title="Название ресурса: <b>Горсть соли</b><br />Собрано: <b>' . $resChurch['502']['count'] . '</b>"></a></td>
<td width="39" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(503);"><img src="/i/sh/103004.gif" title="Название ресурса: <b>Горный хрусталь</b><br />Собрано: <b>' . $resChurch['503']['count'] . '</b>"></a></td>
<td width="30" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(504);"><img src="/i/sh/103005.gif" title="Название ресурса: <b>Бирюза</b><br />Собрано: <b>' . $resChurch['504']['count'] . '</b>"></a></td>
<td width="190" height="60">&nbsp;</td>
</tr>
<tr>
<td width="100%" height="10" colspan="9" >&nbsp;</td>
</tr>
<tr>
<td width="190" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(505);"><img src="/i/sh/103003.gif" title="Название ресурса: <b>Опал</b><br />Собрано: <b>' . $resChurch['505']['count'] . '</b>"></a></td>
<td width="30" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(506);"><img src="/i/sh/103007.gif" title="Название ресурса: <b>Булыжник</b><br />Собрано: <b>' . $resChurch['506']['count'] . '</b>"></a></td>
<td width="39" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(507);"><img src="/i/sh/103008.gif" title="Название ресурса: <b>Камень Лабиринта</b><br />Собрано: <b>' . $resChurch['507']['count'] . '</b>"></a></td>
<td width="30" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(508);"><img src="/i/sh/103006.gif" title="Название ресурса: <b>Гранат</b><br />Собрано: <b>' . $resChurch['508']['count'] . '</b>"></a></td>
<td width="190" height="60">&nbsp;</td>
</tr>
<tr>
<td width="100%" height="10" colspan="9" >&nbsp;</td>
</tr>
<tr>
<td width="190" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(509);"><img src="/i/sh/103009.gif" title="Название ресурса: <b>Янтарь</b><br />Собрано: <b>' . $resChurch['509']['count'] . '</b>"></a></td>
<td width="30" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(510);"><img src="/i/sh/103011.gif" title="Название ресурса: <b>Сапфир</b><br />Собрано: <b>' . $resChurch['510']['count'] . '</b>"></a></td>
<td width="39" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(511);"><img src="/i/sh/103010.gif" title="Название ресурса: <b>Малахит</b><br />Собрано: <b>' . $resChurch['511']['count'] . '</b>"></a></td>
<td width="30" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(512);"><img src="/i/sh/103012.gif" title="Название ресурса: <b>Жемчуг</b><br />Собрано: <b>' . $resChurch['512']['count'] . '</b>"></a></td>
<td width="190" height="60">&nbsp;</td>
</tr>
<tr>
<td width="100%" height="10" colspan="9">&nbsp;</td>
</tr>
<tr>
<td width="277" height="60" colspan="3" valign=center>&nbsp;</td>
<td width="159" height="173" colspan="3" align=center><img style="cursor: pointer;" onclick="document.location.href = \'?got=level11\';" src="/i/sh/temle/paper_shadow.gif" src="/i/sh/temle/paper_shadow.gif" title="Другие Ресурсы" border="0" /></td>
<td width="277" height="60" colspan="3" valign=center>&nbsp;</td>
</tr>
</table>';
} else {
echo'<table border="0" cellpadding=0 cellspacing=0 width="710" height="489" style="background:url(/i/sh/temle/bg.jpg) center no-repeat;">
<tr>
<td width="100%" height="70" colspan="9" >&nbsp;</td>
</tr>
<tr>
<td width="190" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(401);"><img src="/i/sh/ruda.gif" title="Название ресурса: <b>Руда</b><br />Собрано: <b>' . $resChurch['401']['count'] . '</b>"></a></td>
<td width="30" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(402);"><img src="/i/sh/sand.gif" title="Название ресурса: <b>Песок</b><br />Собрано: <b>' . $resChurch['402']['count'] . '</b>"></a></td>
<td width="39" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(403);"><img src="/i/sh/granit.gif" title="Название ресурса: <b>Гранит</b><br />Собрано: <b>' . $resChurch['403']['count'] . '</b>"></a></td>
<td width="30" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(404);"><img src="/i/sh/vosk.gif" title="Название ресурса: <b>Воск</b><br />Собрано: <b>' . $resChurch['404']['count'] . '</b>"></a></td>
<td width="190" height="60">&nbsp;</td>
</tr>
<tr>
<td width="100%" height="10" colspan="9" >&nbsp;</td>
</tr>
<tr>
<td width="190" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(405);"><img src="/i/sh/glina.gif" title="Название ресурса: <b>Глина</b><br />Собрано: <b>' . $resChurch['405']['count'] . '</b>"></a></td>
<td width="30" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(406);"><img src="/i/sh/temple_stone2.gif" title="Название ресурса: <b>Стенной Камень</b><br />Собрано: <b>' . $resChurch['406']['count'] . '</b>"></a></td>
<td width="39" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(407);"><img src="/i/sh/stone_pic.gif" title="Название ресурса: <b>Кусок Настенного Рисунка</b><br />Собрано: <b>' . $resChurch['407']['count'] . '</b>"></a></td>
<td width="30" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(408);"><img src="/i/sh/temple_stone1.gif" title="Название ресурса: <b>Камень Алтаря</b><br />Собрано: <b>' . $resChurch['408']['count'] . '</b>"></a></td>
<td width="190" height="60">&nbsp;</td>
</tr>
<tr>
<td width="100%" height="10" colspan="9" >&nbsp;</td>
</tr>
<tr>
<td width="190" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(409);"><img src="/i/sh/almaz.gif" title="Название ресурса: <b>Алмаз</b><br />Собрано: <b>' . $resChurch['409']['count'] . '</b>"></a></td>
<td width="30" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(410);"><img src="/i/sh/Emerald1.gif" title="Название ресурса: <b>Изумруд</b><br />Собрано: <b>' . $resChurch['410']['count'] . '</b>"></a></td>
<td width="39" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(411);"><img src="/i/sh/silverr.gif" title="Название ресурса: <b>Серебро</b><br />Собрано: <b>' . $resChurch['411']['count'] . '</b>"></a></td>
<td width="30" height="60">&nbsp;</td>
<td width="60" height="60"><a href="javascript:showRating(412);"><img src="/i/sh/gold1.gif" title="Название ресурса: <b>Золото</b><br />Собрано: <b>' . $resChurch['412']['count'] . '</b>"></a></td>
<td width="190" height="60">&nbsp;</td>
</tr>
<tr>
<td width="100%" height="10" colspan="9">&nbsp;</td>
</tr>
<tr>
<td width="277" height="60" colspan="3" valign=center>&nbsp;</td>
<td width="159" height="173" colspan="3" align=center><img style="cursor: pointer;" onclick="document.location.href = \'?got=level11&step=1\';" src="/i/sh/temle/paper_shadow.gif" title="Другие Ресурсы" border="0" /></td>
<td width="277" height="60" colspan="3" valign=center>&nbsp;</td>
</tr>
</table>';
}
echo'</td>
</tr>
</table>';
break;
default:
echo'<div style="float: right;">
<input TYPE="button" value="Подсказка" style="background-color:#A9AFC0" onclick="window.open(\'help/hram.html\', \'help\', \'height=300,width=500,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes\')">
<input type="button" name="hram" onclick="moveTo(2601, \'/city.php\', \'' . vCode(2601, $timeStamp) . '\');" value="Вернуться">
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align=center valign=top>
<div id="ione" style="position:relative;width:790px;height:430px;" align="center">
<img src="i/city/fon.jpg" border="0" />
<img style="position:absolute;cursor:pointer;left:39px;top:19px;z-index:90;" class="aFilter" src="i/city/sub/zals.png" title="Зал Свитков" id="10" onclick="window.location.href = \'?got=level10\';" />
<img style="position:absolute;cursor:pointer;left:548px;top:19px;z-index:90;" class="aFilter" src="i/city/sub/zalp.png" title="Зал Пожертвований" id="11" onclick="window.location.href = \'?got=level11\';" />
<!--
<img style="position:absolute;cursor:pointer;left:154px;top:328px;z-index:90;" class="aFilter" src="i/city/sub/svechas.png" title="Свеча света" id="6" onclick="solo(6, \'' . vCode(2601, $timeStamp) . '\');" />
<img style="position:absolute;cursor:pointer;left:372px;top:318px;z-index:90;" class="aFilter" src="i/city/sub/svechan.png" title="Свеча нейтралов" id="2" onclick="solo(2, \'' . vCode(2601, $timeStamp) . '\');" />
<img style="position:absolute;cursor:pointer;left:584px;top:330px;z-index:90;" class="aFilter" src="i/city/sub/svechad.png" title="Свеча тьмы" id="3" onclick="solo(3, \'' . vCode(2601, $timeStamp) . '\');" />
-->
</div>
</td>
</tr>
</table>';
break;
}
/*
echo serialize(
array(
401 => array('count' => 0), // Руда
402 => array('count' => 0), // Песок
403 => array('count' => 0), // Гранит
404 => array('count' => 0), // Воск
405 => array('count' => 0), // Глина
406 => array('count' => 0), // Стенной камень
407 => array('count' => 0), // Кусок настенного рисунка
408 => array('count' => 0), // Камень Алтаря
409 => array('count' => 0), // Алмаз
410 => array('count' => 0), // Изумруд
411 => array('count' => 0), // Серебро
412 => array('count' => 0), // Золото
501 => array('count' => 0), // Мел
502 => array('count' => 0), // Горсть соли
503 => array('count' => 0), // Горный хрусталь
504 => array('count' => 0), // Бирюза
505 => array('count' => 0), // Опал
506 => array('count' => 0), // Булыжник
507 => array('count' => 0), // Камень Лабиринта
508 => array('count' => 0), // Гранат
509 => array('count' => 0), // Янтарь
510 => array('count' => 0), // Сапфир
511 => array('count' => 0), // Малахит
512 => array('count' => 0), // Жемчуг
)
);
*/
?></body>
</html>

118
city.php
View File

@ -5,70 +5,47 @@
session_start();
if ($_SESSION['uid'] == null) {
header("Location: index.php");
exit;
}
include("config.php");
//$user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1"));
//$klan = mysql_fetch_array(mysql_query("SELECT * FROM `clans` WHERE `id` = '{$user['klan']}' LIMIT 1"));
//$digger = mysql_fetch_array(mysql_query("SELECT * FROM `digger` WHERE `id` = '{$_SESSION['uid']}' LIMIT 1"));
include("functions.php");
require_once "functions.php";
$user = $user ?? [];
$tm = time();
if ($user['battle'] != 0) {
if ($user->battle) {
header('location: fbattle.php');
die();
exit;
}
if ($user['in_tower'] == 1) {
if ($user->in_tower == 1) {
header('Location: towerin.php');
die();
exit;
}
if ($user['zayavka'] != 0) {
die();
if ($user->zayavka) {
exit;
}
/**
* Проверяем можем ли мы двигаться.
*/
function can_i_move()
function move($room, $redirect = null)
{
global $user;
$d = db::c()->query('SELECT SUM(`massa`) AS `mass` FROM `inventory` WHERE `owner` = ?i AND `setsale` = 0', $user['id'])->fetch_assoc();
$eff = db::c()->query('SELECT `type` FROM `effects` WHERE `owner` = ?i AND (`type` = 10 OR `type` = 13 OR `type` = 14)', $user['id'])->fetch_assoc();
$d = db::c()->query('SELECT SUM(`massa`) AS `mass` FROM `inventory` WHERE `owner` = ?i AND `setsale` = 0', $_SESSION['uid'])->fetch_assoc();
$eff = db::c()->query('SELECT `type` FROM `effects` WHERE `owner` = ?i AND (`type` = 10 OR `type` = 13 OR `type` = 14)', $_SESSION['uid'])->fetch_assoc();
if ($d['mass'] > get_meshok()) {
err('У вас переполнен рюкзак, вы не можете передвигаться...');
return false;
return 'У вас переполнен рюкзак, вы не можете передвигаться...';
}
if ($eff['type'] == 10) {
err('Вы парализованы и не можете передвигаться...');
return false;
return 'Вы парализованы и не можете передвигаться...';
}
if ($eff['type'] == 13 || $eff['type'] == 14) {
return 'У вас тяжелая травма, вы не можете передвигаться...';
}
if ($eff['type'] == 13 OR $eff['type'] == 14) {
err('У вас тяжелая травма, вы не можете передвигаться...');
return false;
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i,`online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $room, $room, $_SESSION['uid']);
if ($redirect) {
header('location: ' . $redirect);
exit;
}
return true;
}
function move($room, $redirect = false)
{
if (can_i_move()) {
db::c()->query('UPDATE `users`,`online` SET `users`.`room` = ?i,`online`.`room` = ?i WHERE `online`.`id` = `users`.`id` AND `online`.`id` = ?i', $room, $room, $_SESSION['uid']);
if ($redirect) {
header('location: ' . $redirect);}
die();
}
}
$dig_raw = db::c()->query('SELECT `finish_dig`, `finish_guard` FROM `digger` WHERE `id` = ?i', $user['id'])->fetch_assoc();
if ($dig_raw["finish_dig"] > $tm || $dig_raw["finish_guard"] > $tm) {
header('location: wall_build.php');
die();
}
header("Cache-Control: no-cache");
$location = explode('/', filter_input(INPUT_SERVER, 'QUERY_STRING'));
can_i_move();
switch ($location[0]) {
case 'cp':
move(20, 'city.php');
@ -122,9 +99,6 @@ switch ($location[0]) {
case 'level4':
move(23, 'repair.php');
break;
case 'level9':
move(24, 'new_year.php');
break;
case 'level6':
move(27, 'post.php');
break;
@ -173,9 +147,6 @@ switch ($location[0]) {
case 'room666':
move(666, 'jail.php');
break;
case 'level5':
move(203, 'church.php');
break;
}
} elseif ($user['room'] == 2601) {
switch ($location[1]) {
@ -185,9 +156,6 @@ switch ($location[0]) {
case 'level55':
header('location: city.php?abog');
break;
case 'level44':
move(203, 'church.php');
break; /*FIXME Второй вход в церковь?*/
case 'level1':
move(37, 'gotzamok.php');
break;
@ -212,12 +180,6 @@ switch ($location[0]) {
case 'level10':
header('location: city.php?cp');
break;
case 'level5':
move(1054, 'fontan_luck.php');
break;
case 'level202':
move(1054, 'fontan_luck.php');
break;
case 'level6':
move(61, 'akadem.php');
break;
@ -239,9 +201,6 @@ switch ($location[0]) {
case 'level3':
header('location: city.php?zamk');
break;
case 'level5':
move(43, 'znahar.php');
break;
case 'level660':
move(660, 'hostel.php');
break;
@ -253,21 +212,28 @@ switch ($location[0]) {
break;
}
}
break;
}
function getSeason()
{
$todayMonth = date('n');
if ($todayMonth >= 3 && $todayMonth <= 5) return 'spring_';
if ($todayMonth >= 6 && $todayMonth <= 8) return 'summer_';
if ($todayMonth >= 9 && $todayMonth <= 11) return 'autumn_';
if ($todayMonth >= 3 && $todayMonth <= 5) {
return 'spring_';
}
if ($todayMonth >= 6 && $todayMonth <= 8) {
return 'summer_';
}
if ($todayMonth >= 9 && $todayMonth <= 11) {
return 'autumn_';
}
return 'winter_';
}
function buildset($id, $img, $top, $left, $des, $noSeason = 0)
{
if (!$noSeason) $img = getSeason() . $img;
if (!$noSeason) {
$img = getSeason() . $img;
}
?>
<div style="position:absolute; left:<?= $left ?>px; top:<?= $top ?>px; z-index:90; cursor: pointer;">
<img src="i/city/sub/<?= $img ?>.png" alt="<?= $des ?>" title="<?= $des ?>" class="building"
@ -279,8 +245,12 @@ function buildset($id, $img, $top, $left, $des, $noSeason = 0)
function bgset($img)
{
$daytime = date('H');
if ($daytime >= 6 && $daytime <= 21) $background = getSeason() . $img . '_day';
else $background = getSeason() . $img . '_night';
if ($daytime >= 6 && $daytime <= 21) {
$background = getSeason() . $img . '_day';
}
else {
$background = getSeason() . $img . '_night';
}
echo sprintf('<div style="position:relative; display: inline-block;" id="ione"><img alt="background" src="i/city/%s.jpg">', $background);
}
@ -324,7 +294,7 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
buildset(1, "cap_club", 30, 235, "Бойцовский Клуб");
buildset(2, "cap_shop", 202, 171, "Магазин");
buildset(3, "cap_kom", 205, 105, "Комиссионный магазин");
buildset(4, "cap_rem", 202, 290, "Ремонтная мастерская");;
buildset(4, "cap_rem", 202, 290, "Ремонтная мастерская");
buildset(13, "cap_statue", 222, 365, "Памятник Мэру Города");
buildset(6, "cap_po4ta", 180, 540, "Почта");
buildset(7, "cap_arr_right", 260, 710, "Страшилкина Улица", 1);
@ -336,7 +306,7 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
echo "</div>";
} elseif ($user['room'] == 21) {
bgset('cap_strash');
buildset(5, "cap_bank", 180, 485, "Банк");;
buildset(5, "cap_bank", 180, 485, "Банк");
buildset(14, "cap_registratura", 170, 113, "Регистратура кланов");
buildset(16, "cap_tower", 5, 315, "Башня смерти");
buildset(16555, "cap_tree", 165, 20, "Дерево");
@ -348,7 +318,6 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
bgset('cap_park');
buildset(6, "cap_gate", 170, 340, "Городские ворота", 1);
buildset(660, "cap_vokzal", 163, 43, "Общежитие");
buildset(5, "cap_znah", 195, 538, "Хижина Знахаря");
buildset(3, "cap_arr_left", 259, 27, "Замковая площадь", 1);
buildset(4, "cap_arr_right", 259, 715, "Центральная площадь", 1);
echo "</div>";
@ -358,14 +327,12 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
buildset(10, "ava_post", 240, 300, "Сувенирный магазинчик", 1);
buildset(1, "cap_ruins", 166, 48, "Руины Старого замка");
buildset(1051, "cap_lab", 130, 327, "Вход в Лабиринт Хаоса");
buildset(44, "cap_hram", 173, 550, "Храм Древних");
buildset(55, "cap_arr_left", 258, 21, "Арена Богов", 1);
buildset(4, "cap_arr_right", 260, 710, "Большая парковая улица", 1);
echo "</div>";
} elseif ($user['room'] == 2655) {
bgset('ar_e_n');
buildset(2055, "cap_altr_g", 230, 340, "Арена Ангелов");
buildset(2222, "cap_stop", 258, 21, "Проход закрыт", 1);
buildset(10, "arr_right_png", 260, 710, "Замковая площадь", 1);
echo "</div>";
} elseif ($user['room'] == 2111) {
@ -382,17 +349,14 @@ $online = db::c()->query('SELECT 1 FROM `online` WHERE `real_time` >= ?i', (time
bgset('arena_bg1');
buildset(1, "cap_3strelka", 260, 30, "Берег Залива");
buildset(2, "cap_shar_dark", 234, 356, "Лабиринт Хаоса");
buildset(3, "cap_stop_png", 260, 720, "Проход закрыт");
echo "</div>";
} elseif ($user['room'] == 2702) {
bgset('cap_torg');
buildset(6, "cap_arenda", 175, 70, "Академия");
buildset(202, "cap_fontan", 210, 350, "Фонтан удачи");
buildset(16, "cap_t_build42", 120, 300, "Аукцион");
buildset(16555, "cap_prokat", 155, 480, "Прокатная лавка");
buildset(21, "cap_lombard", 150, 565, "Ломбард");
buildset(10, "cap_arr_uleft", 259, 25, "Центральная площадь", 1);
buildset(3, "cap_stop", 259, 720, "Проход закрыт", 1);
echo "</div>";
}
?>

View File

@ -26,7 +26,7 @@ if ($klanName && $klanAbbr && $klanDescr) {
if ($user->clan) {
$errorMessage .= 'Вы уже состоите в клане!. <BR>';
}
if (10000 >= $user->money) {
if (Config::$clan_register_cost >= $user->money) {
$errorMessage .= 'Не хватает денег на регистрацию клана. <BR>';
}
if (!$eff) {

View File

@ -1,130 +0,0 @@
<?
session_start();
include("config.php");
include("functions.php");
mysql_query('SET NAMES UTF8');
if(!isset($_SESSION['uid'])) { header('Location: /index.php'); }
if($user['klan'] == '' || $user['klan'] != mysql_real_escape_string((int)$_GET['clan'])) { header('Location: /index.php'); }
if($user['clan_prava'] != 'glava') {
$utitl = mysql_fetch_array(mysql_query('SELECT * FROM `clan_tituls` WHERE `id` = "'.$user['clan_prava'].'" LIMIT 1'));
if(!isset($utitl['id'])) {
$utitl = mysql_fetch_array(mysql_query('SELECT * FROM `clan_tituls` WHERE `id` = 2 LIMIT 1'));
}
} else {
$utitl = mysql_fetch_array(mysql_query('SELECT * FROM `clan_tituls` WHERE `id` = 1 LIMIT 1'));
}
if(isset($utitl['id'])) {
$i = 1;
while($i < count($clan_acces)) {
if($utitl['prava'][$i] > 0) {
$clan_acces[$i][0] = 1;
}
$i++;
}
}
if(is_numeric($_GET['page'])) {
$numb = round($_GET['page']*15, 0);
} else {
$numb = 0;
}
if($clan_acces[6][0] == 1) {
$t = '<table border=0 width=100% cellspacing="0" cellpadding="2" bgcolor=CCC3AA><tr><td align=center colspan=2><font color="#003388"><b>Просмотр операций с казной</b></font> <span style="float: right;"><input type="text" id="logins" name="logins" placeholder="Логин" style="text-align: center;" /> <input id="find" type="button" value="Фильтр" /></span></td></tr></table><div id="content"><table width=100% cellspacing="num">';
$data = mysql_query("SELECT * FROM `clan_log` WHERE `clan_id` = '".$user['klan']."' ORDER BY `id` DESC LIMIT $numb, 15");
while($it = mysql_fetch_array($data)) {
$i++;
if($i == 1) {
$t .= "<tr><td class='solid'>&nbsp;</td><td align='left' class='solid'><b>&nbsp;&nbsp;Когда</b></td><td align='left' class='solid'><b>&nbsp;&nbsp;&nbsp;&nbsp;Кто</b></td><td align='right' class='solid'><b>Сколько</b></td></tr>";
}
if($it['type'] == 1) {
$pp = "<img src=\"i/kazna_put.gif\" title=\"Положил кредиты\" />"; $dop = 'Кр.';
} elseif($it['type'] == 2) {
$pp = "<img src=\"i/kazna_put.gif\" title=\"Положил еврокредиты\" />"; $dop = 'Екр.';
}
$it['date'] = date('d.m.y h:i', $it['time']);
$it['login'] = Nick::id($it['user_id'])->full(1);
$it['coms'] = ' <nobr>Комментарий : '.$it['comment'].'</nobr>';
$t .= "<tr><td class='dash' align='center' width='10'>".$pp."</td><td class=dash align=left width=10>&nbsp;&nbsp;<nobr>".$it['date']."</nobr></td><td class='dash' align='left'>&nbsp;<nobr>".$it['login']."</nobr>".$it['coms']."</td><td class='dash' align='right'>".$it['suma']."&nbsp;$dop</td></tr>";
}
$t .= '</table>';
$t .= "Страницы: ";
$data2 = mysql_query("SELECT * FROM `clan_log` WHERE `clan_id`= '{$user['klan']}'"); $all = mysql_num_rows($data2)-1; $pgs = $all/15;
for($is = 0; $is <= $pgs; ++$is) {
if($_GET['page'] == $is) {
$t .= '<font class=number>'.($is+1).'</font>&nbsp;';
} else {
$t .= '<a href="?act=caznalog&clan='.$user['klan'].'&hash='.md5($user['id'].'|'.$user['login']).'&page='.$is.'">'.($is+1).'</a>&nbsp;';
}
$t .= '</div>';
}
} else {
$t = 'Недостаточно прав';
}
?>
<html>
<head>
<title>Просмотр действий с кланом</title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<? if($clan_acces[6][0] == 1) { ?>
<script>
$(function() {
$("#find").on("click", function() {
var login = $("#logins").val();
let hash = '<?=md5($user['
if(!login) {
alert('Введите логин');
} else {
$.ajax({
type: 'POST',
url: 'ajax/clan_log.php',
data: "&user="+<?=$user['id'];?>+"&hash="+hash+"&sorted="+login,
dataType : 'json',
success: function(data) {
if(!data.success) {
alert(data.errors.name);
} else {
$('#content').remove(); $('#pages').remove();
console.log(data.posted);
}
}
})
}
})
})
</script>
<? } ?>
</head>
<body style="background-color: #dedede; margin: 0; padding: 0;">
<style>
td.dash {
border-bottom-style: dotted;
border-color: black;
border-width: 1px;
}
td.solid {
border-bottom-style: solid;
border-color: black;
border-width: 2px;
}
</style>
<?
if($_GET['act'] == 'caznalog') {
$clan = mysql_real_escape_string((int)$_GET['clan']);
if($clan > 0) {
if($_GET['hash'] != '') {
if($_GET['hash'] == md5($user['id'].'|'.$user['login'])) {
echo $t;
}
}
}
}
?>
</body>
</html>

549
classes/Tournament.php Normal file
View File

@ -0,0 +1,549 @@
<?php
class Tournament
{
public $MaxUserLevel = 9;
private $awards = [1 => [1 => 10, 20, 30, 40, 50, 60, 70, 80],
2 => [1 => 8, 15, 20, 30, 35, 45, 50, 60],
3 => [1 => 5, 10, 15, 20, 25, 30, 35, 40]];
function AddUserInTournament(int $id)
{
global $user;
$chek = mysql_fetch_row(mysql_query("select id from turnament where id=" . $id . " and old=0"));
if ($chek[0] == '') {
die("Жаль, очень жаль....");
}
if (mysql_query("insert into turnamuser (idturnam,iduser,level) values(" . $id . "," . $user['id'] . "," . $user['level'] . ")")) {
mysql_query("update turnament set kolvo=kolvo+1 where id=" . $id);
echo "Регистрация пройдена!";
} else {
die("Вы уже зарегистрированы.");
}
}
function DellUserInTournament(int $id)
{
global $user;
mysql_query("delete from turnamuser where idturnam=" . $id . " and iduser=" . $user['id']);
mysql_query("update turnament set kolvo=kolvo-1 where id=" . $id);
echo "Заявка отозвана<br>";
}
function fract($num = 0)
{
if (!is_float($num)) {
return false;
}
$out = explode('.', $num);
return $out[1];
}
function PrepearTournir()
{//запускается за час до начала турнира
for ($i = 1; $i < $this->MaxUserLevel; $i++) {
$uch = mysql_query("select id,iduser from turnamuser where loose=0 and idturnam=(select id from turnament where old=0 and level=" . $i . ") order by id desc");
$kol = mysql_num_rows($uch);
$cop = $kol;
if ($kol > 7) {
while (true) {
$stepen = log($cop) / log(2);
if (!$this->fract($stepen)) { //==false - дробная часть отсутствует
for ($j = 1; $j <= ($kol - $cop); $j++) {
$res = mysql_fetch_row($uch);
mysql_query("delete from turnamuser where id=" . $res[0]);
addchp('<font color=red>Внимание!</font> На этой неделе Вам не нашлелся противник в турнире.<BR>', '{[]}' . Nick::id($res[1])->short() . '{[]}');
}
mysql_query("update turnament set kolvo=kolvo-" . ($kol - $cop) . " where old=0 and level=" . $i);
break;
}
$cop--;
}
$CountUser = [];
while ($res = mysql_fetch_row($uch)) {
$CountUser[] = $res[1];
}
shuffle($CountUser);
for ($ii = 0; $ii < count($CountUser); $ii++) {
$user1 = $CountUser[$ii];
$user2 = $CountUser[++$ii];
mysql_query("insert into turnirbattle(userid,userid1,level,idtur) values(" . $user1 . "," . $user2 . "," . $i . ",(select id from turnament where old=0 and level=" . $i . "))");
addchp('<font color=red>Внимание!</font> Подготовтесь к турниру.<BR>', '{[]}' . Nick::id($user1)->short() . '{[]}');
addchp('<font color=red>Внимание!</font> Подготовтесь к турниру.<BR>', '{[]}' . Nick::id($user2)->short() . '{[]}');
}
} else {
//Если команда не набралась удалить из таблицы и поставить турниру статус 2
while ($res = mysql_fetch_row($uch)) {
mysql_query("delete from turnamuser where id=" . $res['0']);
addchp('<font color=red>Внимание!</font>На этой неделе команда для турнира не набралась.<BR>', '{[]}' . Nick::id($res[1])->short() . '{[]}');
}
mysql_query("delete from turnament where old=0 and level=" . $i);
}
}
}
// созает поединок между 2 юзерами
function MakeBattle($user1, $user2)
{
$res = mysql_fetch_array(mysql_query("select * from turnirbattle where userid=" . $user1 . " or userid1=" . $user1 . " limit 1"));
if ($res['userid1'] == $user1 && $res['badmaxweap1'] != 0) {
if ((time() - $res['badmaxweap1']) > 120) {
mysql_query("update turnamuser set loose=2, place=" . time() . " where iduser=" . $user1 . " and idturnam=" . $res['idtur']);
mysql_query("delete from turnirbattle where userid1=" . $user1);
addchp('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>', '{[]}' . Nick::id($user1)->short() . '{[]}');
addchp('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>', '{[]}' . Nick::id($user2)->short() . '{[]}');
}
} elseif ($res['userid'] == $user2 && $res['badmaxweap'] != 0) {
if ((time() - $res['badmaxweap']) > 120) {
mysql_query("update turnamuser set loose=2, place=" . time() . " where iduser=" . $user2 . " and idturnam=" . $res['idtur']);
mysql_query("delete from turnirbattle where userid=" . $user2);
addchp('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>', '{[]}' . Nick::id($user2)->short() . '{[]}');
addchp('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>', '{[]}' . Nick::id($user1)->short() . '{[]}');
}
} elseif ($res['userid'] == $user1 && $res['badmaxweap'] != 0) {
if ((time() - $res['badmaxweap']) > 120) {
mysql_query("update turnamuser set loose=2, place=" . time() . " where iduser=" . $user1 . " and idturnam=" . $res['idtur']);
mysql_query("delete from turnirbattle where userid=" . $user1);
addchp('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>', '{[]}' . Nick::id($user1)->short() . '{[]}');
addchp('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>', '{[]}' . Nick::id($user2)->short() . '{[]}');
}
} elseif ($res['userid1'] == $user2 && $res['badmaxweap1'] != 0) {
if ((time() - $res['badmaxweap1']) > 120) {
mysql_query("update turnamuser set loose=2, place=" . time() . " where iduser=" . $user2 . " and idturnam=" . $res['idtur']);
mysql_query("delete from turnirbattle where userid1=" . $user2);
addchp('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>', '{[]}' . Nick::id($user2)->short() . '{[]}');
addchp('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>', '{[]}' . Nick::id($user1)->short() . '{[]}');
}
} else {
//Если на человеке лишняя одежда написать чтобы снял поставить время ожидания 2 минуты
$Shmotuser = mysql_fetch_array(mysql_query("select * from users where id=" . $user1));
$Shmotuser1 = mysql_fetch_array(mysql_query("select * from users where id=" . $user2));
$PriceWeap = mysql_fetch_row(mysql_query("select cost from inventory where id=" . $Shmotuser['weap'] . " limit 1")) ?? [];
$PriceWeap1 = mysql_fetch_row(mysql_query("select cost from inventory where id=" . $Shmotuser1['weap'] . " limit 1")) ?? [];
if ($PriceWeap[0] > 16 || $Shmotuser['sergi'] != 0 || $Shmotuser['kulon'] != 0 || $Shmotuser['perchi'] != 0 || $Shmotuser['bron'] != 0 || $Shmotuser['r1'] != 0 || $Shmotuser['r2'] != 0 || $Shmotuser['r3'] != 0 || $Shmotuser['helm'] != 0 || $Shmotuser['shit'] != 0 || $Shmotuser['boots'] != 0 || $Shmotuser['stats'] != 0 || $Shmotuser['m1'] != 0 || $Shmotuser['m2'] != 0 || $Shmotuser['m3'] != 0 || $Shmotuser['m4'] != 0 || $Shmotuser['m5'] != 0 || $Shmotuser['m6'] != 0 || $Shmotuser['m7'] != 0 || $Shmotuser['m8'] != 0 || $Shmotuser['m9'] != 0 || $Shmotuser['m10'] != 0) {
if ($res['userid'] == $user1) {
mysql_query("update turnirbattle set badmaxweap=" . time() . " , checkuser=0 where userid=" . $user1);
}
if ($res['userid1'] == $user1) {
mysql_query("update turnirbattle set badmaxweap1=" . time() . " , checkuser2=0 where userid1=" . $user1);
}
addchp('<font color=red>Внимание!</font>Оставьте оружие только до 16экр или оставьте только оружие.<BR>', '{[]}' . Nick::id($user1)->short() . '{[]}');
} elseif ($PriceWeap1[0] > 16 || $Shmotuser1['sergi'] != 0 || $Shmotuser1['kulon'] != 0 || $Shmotuser1['perchi'] != 0 || $Shmotuser1['bron'] != 0 || $Shmotuser1['r1'] != 0 || $Shmotuser1['r2'] != 0 || $Shmotuser1['r3'] != 0 || $Shmotuser1['helm'] != 0 || $Shmotuser1['shit'] != 0 || $Shmotuser1['boots'] != 0 || $Shmotuser1['stats'] != 0 || $Shmotuser1['m1'] != 0 || $Shmotuser1['m2'] != 0 || $Shmotuser1['m3'] != 0 || $Shmotuser1['m4'] != 0 || $Shmotuser1['m5'] != 0 || $Shmotuser1['m6'] != 0 || $Shmotuser1['m7'] != 0 || $Shmotuser1['m8'] != 0 || $Shmotuser1['m9'] != 0 || $Shmotuser1['m10'] != 0) {
if ($res['userid'] == $user2) {
mysql_query("update turnirbattle set badmaxweap=" . time() . " , checkuser=0 where userid=" . $user2);
}
if ($res['userid1'] == $user2) {
mysql_query("update turnirbattle set badmaxweap1=" . time() . " , checkuser2=0 where userid1=" . $user2);
}
addchp('<font color=red>Внимание!</font>Оставьте оружие только до 16экр или оставьте только оружие.<BR>', '{[]}' . Nick::id($user2)->short() . '{[]}');
} else {
// генерим массив с командами
$teams = [];
$teams[$user1][$user2] = [0, 0, time()];
$teams[$user2][$user1] = [0, 0, time()];
//Востанавливаем HP
mysql_query("update users set hp=maxhp where id=" . $user1 . " or id=" . $user2);
// создаем битву
mysql_query("INSERT INTO `battle`(
`id`,`coment`,`teams`,`timeout`,`type`,`status`,`t1`,`t2`,`to1`,`to2`,`blood`)
VALUES(
NULL,'','" . serialize($teams) . "','3','1','0','" . $user1 . "','" . $user2 . "','" . time() . "','" . time() . "','0')");
// айди боя
$id = mysql_insert_id();
// кидаем в бой
mysql_query("UPDATE `users` SET `battle` = {$id} WHERE `id` = " . $user1 . " OR `id` = " . $user2);
// создаем лог
$rr = "<b>" . Nick::id($user['id'])->full(1) . "</b> и <b>" . Nick::id($jert['id'])->full(1) . "</b>";
addch("<a href=logs.php?log=" . $id . " target=_blank>Бой</a> между <B><b>" . Nick::id($user['id'])->short() . "</b> и <b>" . Nick::id($jert['id'])->short() . "</b> начался. ", $user['room']);
addlog($id, "Часы показывали <span class=date>" . date("Y.m.d H.i") . "</span>, когда " . $rr . " решили выяснить кто из них сильнее. <i>(турнир)</i><BR>");
return $id;
}
}
}
// функция проверки статуса боя
function CheckBattle($id)
{
// если по айдишнику возвращается
// 1 - победил USER1
// 2 - победил USER2
// 3 - бои идет
$res = mysql_fetch_array(mysql_query("SELECT `win` FROM `battle` WHERE `id` = " . (int)$id . " LIMIT 1;"));
return $res['win'];
}
function UpdateTournir()
{
for ($i = 1; $i < $this->MaxUserLevel; $i++) {
$sql = mysql_query("select * from turnirbattle where level=" . $i);
if (mysql_numrows($sql) == 0) {
$this->NextTournir($i);
$this->StartTournir($i);
} else {
echo "Для " . $i . " уровня игроков следующий этап турнира начнется после завершения следующих боёв: <br>";
}
while ($res = mysql_fetch_array($sql)) {
$win = $this->CheckBattle($res['battleid']);
if ($win == 1) {
mysql_query("update turnamuser set place=" . time() . ", loose=loose+1 where iduser=" . $res['userid1']);
mysql_query("update turnamuser set place=0 where iduser=" . $res['userid']);
mysql_query("delete from turnirbattle where id=" . $res['id']);
}
if ($win == 2) {
mysql_query("update turnamuser set place=" . time() . ", loose=loose+1 where iduser=" . $res['userid']);
mysql_query("update turnamuser set place=0 where iduser=" . $res['userid1']);
mysql_query("delete from turnirbattle where id=" . $res['id']);
}
if ($win == 3) {
echo Nick::id($res['userid'])->full(1) . " против " . Nick::id($res['useridl'])->full(1);
}
}
}
}
function NextTournir($level)
{
$CheckFinal = [];
for ($i = 0; $i <= 1; $i++) {
$sql = mysql_query("select iduser from turnamuser where level=" . $level . " and loose=" . $i . " and idturnam=(select id from turnament where old=0 and level=" . $level . ")");
$ArrayUsers = [];
while ($res = mysql_fetch_row($sql)) {
$ArrayUsers[] = $res[0];
}
shuffle($CountUser);
if (count($ArrayUsers) == 1) {
$CheckFinal[] = $ArrayUsers[0];
}
if (count($ArrayUsers) == 1 && $i == 0) {
addchp('<font color=red>Внимание!</font> Вы вышли в финал. Дождитесь второго финалиста.<BR>', '{[]}' . Nick::id($ArrayUsers[0])->short() . '{[]}');
}
if ($this->fract(count($ArrayUsers) / 2)) {
$countUs = count($ArrayUsers) - 1;
} else {
$countUs = count($ArrayUsers);
}
for ($ii = 0; $ii < $countUs; $ii++) {
$user1 = $ArrayUsers[$ii];
$user2 = $ArrayUsers[++$ii];
//Востанавливаем HP
mysql_query("update users set hp=maxhp where id=" . $user1 . " or id=" . $user2);
mysql_query("insert into turnirbattle(userid,userid1,level,idtur) values(" . $user1 . "," . $user2 . "," . $level . ",(select id from turnament where old=0 and level=" . $level . "))");
addchp('<font color=red>Внимание!</font> Подготовтесь к следующему туру.<BR>', '{[]}' . Nick::id($user1)->short() . '{[]}');
addchp('<font color=red>Внимание!</font> Подготовтесь к следующему туру.<BR>', '{[]}' . Nick::id($user2)->short() . '{[]}');
}
}
if (count($CheckFinal) == 2) {
$this->TournirFinal($level, $CheckFinal);
}
if (count($CheckFinal) == 1) {
$this->CreateHTML($level);
//поставить турниру статус 2. создать HTML для подгрузки результатов
//Если команда не набралась - удалить турнир. - эо при старте в 4 часа.
$this->ShowTournirFinaliats($level);
}
}
function CreateHTML($level)
{
$dir = "logtur/" . $level;
if (!file_exists($dir)) {
mkdir($dir);
}
$tur = mysql_fetch_array(mysql_query("select * from turnament where old=0 and level=" . $level . " limit 1"));
$f = fopen($dir . "/" . $tur['datetime'] . ".html", 'w+');
fwrite($f, '<html><head><TITLE></TITLE><META content="text/html; charset=utf-8" http-equiv=Content-type></head>');
fwrite($f, '<bpdy><table><tr><td>Игрок</td><td>Место</td></tr>');
mysql_query("update turnamuser set place=" . (time() + 1000) . " where place=0 and idturnam=" . $tur['id'] . " and level=" . $level);
$sql = mysql_query("select tur.*, us.login from turnamuser as tur left join users as us on us.id=tur.iduser where tur.idturnam=" . $tur['id'] . " order by tur.place desc");
$i = 1;
while ($res = mysql_fetch_array($sql)) {
if ($i == 1 || $i == 2 || $i == 3) {
mysql_query("INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','" . $res['iduser'] . "','Выиграл в турнире " . $this->awards[$i][$level] . " кр.','1','" . time() . "');");
addchp('<font color=red>Внимание!</font> За ' . $i . ' место в турнире, Вы получили ' . $this->awards[$i][$level] . ' кр.<BR>', '{[]}' . Nick::id($res['iduser'])->short() . '{[]}');
}
fwrite($f, '<tr><td>' . $res['login'] . '</td><td>' . $i++ . '</td></tr>');
}
fwrite($f, '</table></body></html>');
fclose($f);
mysql_query("update turnament set old=2, path='/" . $dir . "/" . $tur['datetime'] . ".html' where old=0 and level=" . $level);
if (mysql_numrows(mysql_query("select id from turnament where old=0")) == 0) {
$this->CreateTournament("Еженедельные турниры");
}
}
function ShowTournirFinaliats()
{
$sql = mysql_query("select datetime,level,path from turnament where old=2 group by level order by datetime");
$level = 0;
echo "Результаты прошедших турниров.<br><table border='0' style='background-color:#E0E0E0;'><tr><td>Уровень</td><td>Дата</td></tr>";
while ($res = mysql_fetch_array($sql)) {
if ($level != $res['level']) {
echo "<tr><td>" . $res['level'] . "</td>";
}
echo "<td><a href='http://capitalcity.oldbk.com" . $res['path'] . "'>" . date("d.m.Y H:i", $res['datetime']) . "</a></td>";
if ($level != $res['level']) {
echo "</tr>";
$level = $res['level'];
}
}
echo "</table>";
}
function TournirFinal($level, $masFinals)
{
mysql_query("update turnamuser set place=0 where (iduser=" . $masFinals[0] . " or iduser=" . $masFinals[1] . ") and idturnam=(select id from turnament where old=0 and level=" . $level . ")");
mysql_query("insert into turnirbattle(userid,userid1,level,idtur) values(" . $masFinals[0] . "," . $masFinals[1] . "," . $level . ",(select id from turnament where old=0 and level=" . $level . "))");
addchp('<font color=red>Внимание!</font> Подготовтесь к финалу.<BR>', '{[]}' . Nick::id($masFinals[0])->short() . '{[]}');
addchp('<font color=red>Внимание!</font> Подготовтесь к финалу.<BR>', '{[]}' . Nick::id($masFinals[1])->short() . '{[]}');
}
function expectationenemy()
{
global $user;
$res = mysql_fetch_array(mysql_query("select * from turnirbattle where userid=" . $user['id'] . " or userid1=" . $user['id'] . " limit 1"));
if ($res['id'] != '') {
if ($res['userid'] == $user['id'] && $res['checkuser'] == 0 && $res['badmaxweap'] == 0) {
mysql_query("update turnirbattle set checkuser=1 where userid=" . $user['id']);
if ($res['checkuser2'] == 1) {
$battle = $this->MakeBattle($res['userid'], $res['userid1']);
mysql_query("update turnirbattle set battleid=" . $battle . " where id=" . $res['id']);
}
} elseif ($res['badmaxweap'] != 0) {
if ((time() - $res['badmaxweap']) > 120) {
mysql_query("update turnamuser set loose=2, place=" . time() . " where iduser=" . $res['userid'] . " and idturnam=" . $res['idtur']);
mysql_query("delete from turnirbattle where userid=" . $res['userid']);
addchp('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>', '{[]}' . Nick::id($res['userid'])->short() . '{[]}');
addchp('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>', '{[]}' . Nick::id($res['userid1'])->short() . '{[]}');
}
}
if ($res['userid1'] == $user['id'] && $res['checkuser2'] == 0 && $res['badmaxweap1'] == 0) {
mysql_query("update turnirbattle set checkuser2=1 where userid1=" . $user['id']);
if ($res['checkuser'] == 1) {
$battle = $this->MakeBattle($res['userid'], $res['userid1']);
mysql_query("update turnirbattle set battleid=" . $battle . " where id=" . $res['id']);
}
} elseif ($res['badmaxweap1'] != 0) {
if ((time() - $res['badmaxweap1']) > 120) {
mysql_query("update turnamuser set loose=2, place=" . time() . " where iduser=" . $res['userid'] . " and idturnam=" . $res['idtur1']);
mysql_query("delete from turnirbattle where userid1=" . $res['userid1']);
addchp('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>', '{[]}' . Nick::id($res['userid1'])->short() . '{[]}');
addchp('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>', '{[]}' . Nick::id($res['userid'])->short() . '{[]}');
}
}
}
}
function StartTournir($level = null)
{//Запускается в 17-00-10 каждую пятницу
//Разослать всем кнопочки на вход в турнир
global $user;
$res = mysql_fetch_array(mysql_query("select * from turnirbattle where userid=" . $user['id'] . " or userid1=" . $user['id'] . " limit 1"));
$PriceWeap = mysql_fetch_row(mysql_query("select cost from inventory where id=" . $user['weap'] . " limit 1")) ?? [];
if ($PriceWeap[0] > 16 || $user['sergi'] != 0 || $user['kulon'] != 0 || $user['perchi'] != 0 || $user['bron'] != 0 || $user['r1'] != 0 || $user['r2'] != 0 || $user['r3'] != 0 || $user['helm'] != 0 || $user['shit'] != 0 || $user['boots'] != 0 || $user['stats'] != 0 || $user['m1'] != 0 || $user['m2'] != 0 || $user['m3'] != 0 || $user['m4'] != 0 || $user['m5'] != 0 || $user['m6'] != 0 || $user['m7'] != 0 || $user['m8'] != 0 || $user['m9'] != 0 || $user['m10'] != 0) {
if ($res['userid'] == $user['id'] && $res['badmaxweap'] == 0) {
mysql_query("update turnirbattle set badmaxweap=" . time() . " , checkuser=0 where userid=" . $user['id']);
}
if ($res['userid1'] == $user['id'] && $res['badmaxweap1'] == 0) {
mysql_query("update turnirbattle set badmaxweap1=" . time() . " , checkuser2=0 where userid1=" . $user['id']);
}
addchp('<font color=red>Внимание!</font>Оставьте оружие только до 16экр или оставьте только оружие.<BR>', '{[]}' . Nick::id($user['id'])->short() . '{[]}');
} else {
if ($res['userid'] == $user['id']) {
mysql_query("update turnirbattle set badmaxweap=0 where userid=" . $user['id']);
}
if ($res['userid1'] == $user['id']) {
mysql_query("update turnirbattle set badmaxweap1=0 where userid1=" . $user['id']);
}
}
$sql = mysql_query("select * from turnirbattle where badmaxweap1<>0 or badmaxweap<>0");
while ($res = mysql_fetch_array($sql)) {
if ($res['badmaxweap1'] != 0 && (time() - $res['badmaxweap1']) > 120) {
mysql_query("update turnamuser set loose=2, place=" . time() . " where iduser=" . $res['userid1'] . " and idturnam=" . $res['idtur']);
mysql_query("delete from turnirbattle where userid1=" . $res['userid1']);
addchp('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>', '{[]}' . Nick::id($res['userid1'])->short() . '{[]}');
addchp('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>', '{[]}' . Nick::id($res['userid'])->short() . '{[]}');
}
if ($res['badmaxweap'] != 0 && (time() - $res['badmaxweap']) > 120) {
mysql_query("update turnamuser set loose=2, place=" . time() . " where iduser=" . $res['userid'] . " and idturnam=" . $res['idtur']);
mysql_query("delete from turnirbattle where userid=" . $res['userid']);
addchp('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>', '{[]}' . Nick::id($res['userid'])->short() . '{[]}');
addchp('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>', '{[]}' . Nick::id($res['userid1'])->short() . '{[]}');
}
}
if ($level != '') {
$level = ' and level=' . $level;
}
$sql = mysql_query("SELECT * FROM turnirbattle WHERE (userid=" . $user['id'] . " or userid1=" . $user['id'] . ") " . $level);
while ($res = mysql_fetch_array($sql)) {
$looseL1 = mysql_fetch_row(mysql_query("select loose from turnamuser where iduser=" . $res['userid1'] . " and idturnam=" . $res['idtur']));
$looseL = mysql_fetch_row(mysql_query("select loose from turnamuser where iduser=" . $res['userid'] . " and idturnam=" . $res['idtur']));
if ($res['userid'] == $user['id']) {
if ($res['checkuser'] == 0) {
if ($res['badmaxweap'] != 0) {
if ((time() - $res['badmaxweap']) > 120) {
mysql_query("update turnamuser set loose=2, place=" . time() . " where iduser=" . $res['userid'] . " and idturnam=" . $res['idtur']);
mysql_query("delete from turnirbattle where userid=" . $res['userid']);
addchp('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>', '{[]}' . Nick::id($res['userid'])->short() . '{[]}');
addchp('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>', '{[]}' . Nick::id($res['userid1'])->short() . '{[]}');
} else {
echo "<form method='post'><input type='submit' name='expenemy' value='Я готов'> противник " . Nick::id($res['useridl'])->full(1) . "(поражений-" . $looseL1[0] . ")</form>";
}
} else {
echo "<form method='post'><input type='submit' name='expenemy' value='Я готов'> противник " . Nick::id($res['useridl'])->full(1) . "(поражений-" . $looseL1[0] . ")</form>";
}
} else {
echo "Ожидаем противника";
}
}
if ($res['userid1'] == $user['id']) {
if ($res['checkuser2'] == 0) {
if ($res['badmaxweap1'] != 0) {
if ((time() - $res['badmaxweap1']) > 120) {
mysql_query("update turnamuser set loose=2, place=" . time() . " where iduser=" . $res['userid1'] . " and idturnam=" . $res['idtur']);
mysql_query("delete from turnirbattle where userid1=" . $res['userid1']);
addchp('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>', '{[]}' . Nick::id($res['userid1'])->short() . '{[]}');
addchp('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>', '{[]}' . Nick::id($res['userid'])->short() . '{[]}');
} else {
echo "<form method='post'><input type='submit' name='expenemy' value='Я готов'>противник " . Nick::id($res['userid'])->full(1) . "(поражений-" . $looseL[0] . ")</form>";
}
} else {
echo "<form method='post'><input type='submit' name='expenemy' value='Я готов'>противник " . Nick::id($res['userid'])->full(1) . "(поражений-" . $looseL[0] . ")</form>";
}
} else {
echo "Ожидаем противника";
}
}
}
}
function CreateTournament($title)
{
//Вычисляем следующую пятницу
$dateTime = '';
if (date("w", mktime(0, 0, 0, date('n'), date('j'), date('Y'))) == 5 && date("H") > 17) {
$nextDay = date('j') + 1;
$DayofMonth = date('j');
if ($nextDay > date('t')) {
$nextDay = 1;
$DayofMonth = date("t", mktime(0, 0, 0, date('n') + 1, 1, date('Y')));//даже если date('n')+1 = 13 mktime переведет на 01.01.следующий год
}
} else {
$nextDay = date('j');
$DayofMonth = date('t');
}
for ($j = $nextDay; $j <= $DayofMonth; $j++) {
//узнаем день недели
$DayofWeek = date("w", mktime(0, 0, 0, date('n'), $j, date('Y')));
if ($DayofWeek == 5) {
$dateTime = mktime(17, 0, 0, date('n'), $j, date('Y'));
break;
}
}
//если пятниц в этом месяце не осталось
if ($dateTime == '') {
if (date("n") + 1 == 13) {
$Month = 1;
$Year = date("Y") + 1;
} else {
$Month = date('n') + 1;
$Year = date("Y");
}
for ($j = 1; $j <= date('t', mktime(0, 0, 0, $Month, 1, $Year)); $j++) {
//узнаем день недели
$DayofWeek = date("w", mktime(0, 0, 0, $Month, $j, $Year));
if ($DayofWeek == 5) {
$dateTime = mktime(17, 0, 0, $Month, $j, $Year);
break;
}
}
}
//Создаем турниры.
for ($i = 1; $i < $this->MaxUserLevel; $i++)
if (!mysql_query("insert into turnament(title,level,datetime) values ('" . $title . "'," . $i . ",'" . $dateTime . "')")) {
$f = fopen('/tmp/memcache/logtur/error.log', 'w');
fwrite($f, "insert into turnament(title,level,datetime) values ('" . $title . "'," . $i . ",'" . $dateTime . "')\n");
fclose($f);
}
}
function showAllTurnament()
{
global $user;
$sql = mysql_query("select * from turnament where old=0");
$dateD = mysql_fetch_row(mysql_query("select datetime from turnament where old=0 limit 1"));
if (mysql_num_rows($sql) < 1) {
echo "На данный момент новых чемпионатов нет";
}
if ($user['level'] > 0 && mktime() < $dateD[0]) {
echo "<form method='post'>";
}
echo "<table border=1 style='font-weight:bold;'>
<tr>
<td>Название турнира</td>
<td>Время проведения</td>
<td>Кол-во учасников</td>
<td>Уровень</td>";
if ($user['level'] > 0 && mktime() < $dateD[0]) {
echo "<td>Регистрация</td>";
}
echo "</tr>";
while ($res = mysql_fetch_array($sql)) {
if ($user['level'] == $res['level']) {
$dellzay = mysql_fetch_row(mysql_query("select id from turnamuser where iduser=" . $user['id'] . " and idturnam=" . $res['id']));
}
echo "<tr>
<td>
" . $res['title'] . "
</td>
<td>
" . date("d.m.Y H:i", $res['datetime']) . "
</td>
<td>
" . $res['kolvo'] . "
</td>
<td>
" . $res['level'] . "
</td>";
if ($user['level'] == $res['level'] && mktime() < $dateD[0]) {
if ($dellzay[0] == '') {
echo "<td>
<input type='submit' name='addzayvka' value='Зарегистрироваться'>
<input type='hidden' name='idtur' value='" . $res['id'] . "'>
</td>";
}
else {
echo "<td>
<input type='submit' name='dellzayvka' value='Отказаться'>
<input type='hidden' name='idtur' value='" . $res['id'] . "'>
</td>";
}
}
echo "</tr>";
}
echo "</table>";
if ($user['level'] > 0 && mktime() < $dateD[0]) {
echo "</form>";
}
}
}

View File

@ -5,6 +5,7 @@
trait UserEffects
{
public static $effectName = [
10 => 'паралич',
11 => 'легкая травма',
12 => 'средняя травма',
13 => 'тяжёлая травма',

View File

@ -1,22 +1,22 @@
<?php
if(in_array($user['room'], Config::$caverooms)) {
include_once("cavedata.php");
$floor = mysql_fetch_row(mysql_query("SELECT `floor` FROM `caveparties` WHERE `user` = '$user[id]' LIMIT 1"));
if(!isset($cavedata[$user['room']]['x'.$floor])) {
$floor = 1;
}
if (in_array($user['room'], Config::$caverooms)) {
$cavedata = Config::$cavedata ?? [];
$floor = mysql_fetch_row(mysql_query("SELECT `floor` FROM `caveparties` WHERE `user` = '$user[id]' LIMIT 1"));
if (!isset($cavedata[$user['room']]['x' . $floor])) {
$floor = 1;
}
}
$lomka1 = $lomka;
foreach($lomka1 as $k => $v) {
if($v < _BOTSEPARATOR_) {
if(in_array($user['room'], Config::$caverooms)) {
mysql_query("UPDATE `caveparties` SET `floor` = $floor, `x` = '".$cavedata[$user['room']]['x'.$floor]."', `y` = '".$cavedata[$user['room']]['y'.$floor]."', `dir` = '".$cavedata[$user['room']]['dir'.$floor]."', `loses` = (`loses`+1) WHERE `user` = '$v' LIMIT 1");
foreach ($lomka1 as $k => $v) {
if ($v < _BOTSEPARATOR_) {
if (in_array($user['room'], Config::$caverooms)) {
mysql_query("UPDATE `caveparties` SET `floor` = $floor, `x` = '" . $cavedata[$user['room']]['x' . $floor] . "', `y` = '" . $cavedata[$user['room']]['y' . $floor] . "', `dir` = '" . $cavedata[$user['room']]['dir' . $floor] . "', `loses` = (`loses`+1) WHERE `user` = '$v' LIMIT 1");
}
if ($user['laba'] > 0) {
mysql_query('UPDATE `users` SET `x` = `xf`, `y` = `yr` WHERE `id` = "' . $v . '" LIMIT 1');
die('Suka');
}
}
if($user['laba'] > 0) {
mysql_query('UPDATE `users` SET `x` = `xf`, `y` = `yr` WHERE `id` = "'.$v.'" LIMIT 1');
die('Suka');
}
}
}

View File

@ -1,522 +0,0 @@
<?
$Priz=array(1=>array(1=>10,20,30,40,50,60,70,80),
2=>array(1=>8,15,20,30,35,45,50,60),
3=>array(1=>5,10,15,20,25,30,35,40));
class TTournament {
public
$MaxUserLevel=9;
/* function __construct($id){
}
function __destruct(){
}*/
function AddUserInTournament($id){
global $user;
$chek=mysql_fetch_row(mysql_query("select id from turnament where id=".$id." and old=0"));
if ($chek[0]=='') die("Жаль, очень жаль....");
if (mysql_query("insert into turnamuser (idturnam,iduser,level) values(".$id.",".$user['id'].",".$user['level'].")")){
mysql_query("update turnament set kolvo=kolvo+1 where id=".$id);
echo "Регистрация пройдена!";
}
else die("Вы уже зарегистрированы.");
}
function DellUserInTournament($id){
global $user;
mysql_query("delete from turnamuser where idturnam=".$id." and iduser=".$user['id']);
mysql_query("update turnament set kolvo=kolvo-1 where id=".$id);
echo "Заявка отозвана<br>";
}
function fract($num = 0) {
if(!is_double($num)) return false;
$out = explode('.', $num);
return $out[1];
}
function PrepearTournir(){//запускается за час до начала турнира
for ($i=1;$i<$this->MaxUserLevel;$i++){
$uch=mysql_query("select id,iduser from turnamuser where loose=0 and idturnam=(select id from turnament where old=0 and level=".$i.") order by id desc");
$kol=mysql_num_rows($uch);
$cop=$kol;
if ($kol>7){
While (true){
$stepen=log($cop)/log(2);
if ($this->fract($stepen)==false){ //==false - дробная часть отсутствует
for($j=1;$j<=($kol-$cop);$j++){
$res=mysql_fetch_row($uch);
mysql_query("delete from turnamuser where id=".$res[0]);
addchp ('<font color=red>Внимание!</font> На этой неделе Вам не нашлелся противник в турнире.<BR>','{[]}'.Nick::id($res[1])->short().'{[]}');
}
mysql_query("update turnament set kolvo=kolvo-".($kol-$cop)." where old=0 and level=".$i);
break;
}
$cop--;
}
$CountUser=array();
while ($res=mysql_fetch_row($uch)){
$CountUser[]=$res[1];
}
@shuffle($CountUser);
for ($ii=0;$ii<count($CountUser);$ii++){
$user1=$CountUser[$ii];
$user2=$CountUser[++$ii];
mysql_query("insert into turnirbattle(userid,userid1,level,idtur) values(".$user1.",".$user2.",".$i.",(select id from turnament where old=0 and level=".$i."))");
addchp ('<font color=red>Внимание!</font> Подготовтесь к турниру.<BR>','{[]}'.Nick::id($user1)->short().'{[]}');
addchp ('<font color=red>Внимание!</font> Подготовтесь к турниру.<BR>','{[]}'.Nick::id($user2)->short().'{[]}');
}
}
else{
//Если команда не набралась удалить из таблицы и поставить турниру статус 2
while ($res=mysql_fetch_row($uch)){
mysql_query("delete from turnamuser where id=".$res['0']);
addchp ('<font color=red>Внимание!</font>На этой неделе команда для турнира не набралась.<BR>','{[]}'.Nick::id($res[1])->short().'{[]}');
}
mysql_query("delete from turnament where old=0 and level=".$i);
}
}
}
// созает поединок между 2 юзерами
function MakeBattle ($user1,$user2) {
$res=mysql_fetch_array(mysql_query("select * from turnirbattle where userid=".$user1." or userid1=".$user1." limit 1"));
if ($res['userid1']==$user1 && $res['badmaxweap1']!=0 ){
if ((time()-$res['badmaxweap1'])>120){
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$user1." and idturnam=".$res['idtur']);
mysql_query("delete from turnirbattle where userid1=".$user1);
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.Nick::id($user1)->short().'{[]}');
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.Nick::id($user2)->short().'{[]}');
}
}elseif ($res['userid']==$user2 && $res['badmaxweap']!=0){
if ((time()-$res['badmaxweap'])>120){
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$user2." and idturnam=".$res['idtur']);
mysql_query("delete from turnirbattle where userid=".$user2);
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.Nick::id($user2)->short().'{[]}');
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.Nick::id($user1)->short().'{[]}');
}
}
elseif ($res['userid']==$user1 && $res['badmaxweap']!=0){
if ((time()-$res['badmaxweap'])>120){
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$user1." and idturnam=".$res['idtur']);
mysql_query("delete from turnirbattle where userid=".$user1);
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.Nick::id($user1)->short().'{[]}');
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.Nick::id($user2)->short().'{[]}');
}
}
elseif ($res['userid1']==$user2 && $res['badmaxweap1']!=0 ){
if ((time()-$res['badmaxweap1'])>120){
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$user2." and idturnam=".$res['idtur']);
mysql_query("delete from turnirbattle where userid1=".$user2);
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.Nick::id($user2)->short().'{[]}');
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.Nick::id($user1)->short().'{[]}');
}
}
else{
//Если на человеке лишняя одежда написать чтобы снял поставить время ожидания 2 минуты
$Shmotuser=mysql_fetch_array(mysql_query("select * from users where id=".$user1));
$Shmotuser1=mysql_fetch_array(mysql_query("select * from users where id=".$user2));
$PriceWeap=mysql_fetch_row(mysql_query("select cost from inventory where id=".$Shmotuser['weap']." limit 1"));
$PriceWeap1=mysql_fetch_row(mysql_query("select cost from inventory where id=".$Shmotuser1['weap']." limit 1"));
if ($PriceWeap[0]=='') $PriceWeap[0]=0;
if ($PriceWeap1[0]=='') $PriceWeap1[0]=0;
if ($PriceWeap[0]>16 || $Shmotuser['sergi']!=0 || $Shmotuser['kulon']!=0 || $Shmotuser['perchi']!=0 || $Shmotuser['bron']!=0 || $Shmotuser['r1']!=0 || $Shmotuser['r2']!=0 || $Shmotuser['r3']!=0 || $Shmotuser['helm']!=0 || $Shmotuser['shit']!=0 || $Shmotuser['boots']!=0 || $Shmotuser['stats']!=0 || $Shmotuser['m1']!=0 || $Shmotuser['m2']!=0 || $Shmotuser['m3']!=0 || $Shmotuser['m4']!=0 || $Shmotuser['m5']!=0 || $Shmotuser['m6']!=0 || $Shmotuser['m7']!=0 || $Shmotuser['m8']!=0 || $Shmotuser['m9']!=0 || $Shmotuser['m10']!=0){
if ($res['userid']==$user1)
mysql_query("update turnirbattle set badmaxweap=".time()." , checkuser=0 where userid=".$user1);
if ($res['userid1']==$user1)
mysql_query("update turnirbattle set badmaxweap1=".time()." , checkuser2=0 where userid1=".$user1);
addchp ('<font color=red>Внимание!</font>Оставьте оружие только до 16экр или оставьте только оружие.<BR>','{[]}'.Nick::id($user1)->short().'{[]}');
}
elseif ($PriceWeap1[0]>16 || $Shmotuser1['sergi']!=0 || $Shmotuser1['kulon']!=0 || $Shmotuser1['perchi']!=0 || $Shmotuser1['bron']!=0 || $Shmotuser1['r1']!=0 || $Shmotuser1['r2']!=0 || $Shmotuser1['r3']!=0 || $Shmotuser1['helm']!=0 || $Shmotuser1['shit']!=0 || $Shmotuser1['boots']!=0 || $Shmotuser1['stats']!=0 || $Shmotuser1['m1']!=0 || $Shmotuser1['m2']!=0 || $Shmotuser1['m3']!=0 || $Shmotuser1['m4']!=0 || $Shmotuser1['m5']!=0 || $Shmotuser1['m6']!=0 || $Shmotuser1['m7']!=0 || $Shmotuser1['m8']!=0 || $Shmotuser1['m9']!=0 || $Shmotuser1['m10']!=0){
if ($res['userid']==$user2)
mysql_query("update turnirbattle set badmaxweap=".time()." , checkuser=0 where userid=".$user2);
if ($res['userid1']==$user2)
mysql_query("update turnirbattle set badmaxweap1=".time()." , checkuser2=0 where userid1=".$user2);
addchp ('<font color=red>Внимание!</font>Оставьте оружие только до 16экр или оставьте только оружие.<BR>','{[]}'.Nick::id($user2)->short().'{[]}');
}
else{
// генерим массив с командами
$teams = array();
$teams[$user1][$user2] = array(0,0,time());
$teams[$user2][$user1] = array(0,0,time());
//Востанавливаем HP
mysql_query("update users set hp=maxhp where id=".$user1." or id=".$user2);
// создаем битву
mysql_query("INSERT INTO `battle`(
`id`,`coment`,`teams`,`timeout`,`type`,`status`,`t1`,`t2`,`to1`,`to2`,`blood`)
VALUES(
NULL,'','".serialize($teams)."','3','1','0','".$user1."','".$user2."','".time()."','".time()."','0')");
// айди боя
$id = mysql_insert_id();
// кидаем в бой
mysql_query("UPDATE `users` SET `battle` = {$id} WHERE `id` = ".$user1." OR `id` = ".$user2);
// создаем лог
$rr = "<b>".Nick::id($user['id'])->full(1)."</b> и <b>".Nick::id($jert['id'])->full(1)."</b>";
addch ("<a href=logs.php?log=".$id." target=_blank>Бой</a> между <B><b>".Nick::id($user['id'])->short()."</b> и <b>".Nick::id($jert['id'])->short()."</b> начался. ",$user['room']);
addlog($id,"Часы показывали <span class=date>".date("Y.m.d H.i")."</span>, когда ".$rr." решили выяснить кто из них сильнее. <i>(турнир)</i><BR>");
return $id;
}
}
}
// функция проверки статуса боя
function CheckBattle($id) {
// если по айдишнику возвращается
// 1 - победил USER1
// 2 - победил USER2
// 3 - бои идет
$res = mysql_fetch_array(mysql_query("SELECT `win` FROM `battle` WHERE `id` = ".(int)$id." LIMIT 1;"));
return $res['win'];
}
function UpdateTournir(){
for($i=1;$i<$this->MaxUserLevel;$i++){
$sql=mysql_query("select * from turnirbattle where level=".$i);
if (mysql_numrows($sql)==0){
$this->NextTournir($i);
//$this->StartTournir($i);
}
else {
echo "Для ".$i." уровня игроков следующий этап турнира начнется после завершения следующих боёв: <br>";
}
while($res=mysql_fetch_array($sql)){
$win=$this->CheckBattle($res['battleid']);
if ($win==1){
mysql_query("update turnamuser set place=".time().", loose=loose+1 where iduser=".$res['userid1']);
mysql_query("update turnamuser set place=0 where iduser=".$res['userid']);
mysql_query("delete from turnirbattle where id=".$res['id']);
}
if($win==2){
mysql_query("update turnamuser set place=".time().", loose=loose+1 where iduser=".$res['userid']);
mysql_query("update turnamuser set place=0 where iduser=".$res['userid1']);
mysql_query("delete from turnirbattle where id=".$res['id']);
}
if($win==3){
echo Nick::id($res['userid'])->full(1)." против ".Nick::id($res['useridl'])->full(1);
}
}
}
}
function NextTournir($level){
$CheckFinal=array();
for ($i=0;$i<=1;$i++){
$sql=mysql_query("select iduser from turnamuser where level=".$level." and loose=".$i." and idturnam=(select id from turnament where old=0 and level=".$level.")");
$ArrayUsers=array();
while ($res=mysql_fetch_row($sql)){
$ArrayUsers[]=$res[0];
}
@shuffle($CountUser);
if (count($ArrayUsers)==1) $CheckFinal[]=$ArrayUsers[0];
if (count($ArrayUsers)==1 && $i==0) addchp ('<font color=red>Внимание!</font> Вы вышли в финал. Дождитесь второго финалиста.<BR>','{[]}'.Nick::id($ArrayUsers[0])->short().'{[]}');
if ($this->fract(count($ArrayUsers)/2)!=false)
$countUs=count($ArrayUsers)-1;
else
$countUs=count($ArrayUsers);
for ($ii=0;$ii<$countUs;$ii++){
$user1=$ArrayUsers[$ii];
$user2=$ArrayUsers[++$ii];
//Востанавливаем HP
mysql_query("update users set hp=maxhp where id=".$user1." or id=".$user2);
mysql_query("insert into turnirbattle(userid,userid1,level,idtur) values(".$user1.",".$user2.",".$level.",(select id from turnament where old=0 and level=".$level."))");
addchp ('<font color=red>Внимание!</font> Подготовтесь к следующему туру.<BR>','{[]}'.Nick::id($user1)->short().'{[]}');
addchp ('<font color=red>Внимание!</font> Подготовтесь к следующему туру.<BR>','{[]}'.Nick::id($user2)->short().'{[]}');
}
}
if (count($CheckFinal)==2) $this->TournirFinal($level,$CheckFinal);
if (count($CheckFinal)==1) {
$this->CreateHTML($level);
//поставить турниру статус 2. создать HTML для подгрузки результатов
//Если команда не набралась - удалить турнир. - эо при старте в 4 часа.
//$this->ShowTournirFinaliats($level);
}
}
function CreateHTML($level){
global $Priz;
$dir="logtur/".$level;
if (!file_exists($dir)) mkdir($dir);
$tur=mysql_fetch_array(mysql_query("select * from turnament where old=0 and level=".$level." limit 1"));
$f=fopen($dir."/".$tur['datetime'].".html",'w+');
fwrite($f,'<html><head><TITLE></TITLE><META content="text/html; charset=utf-8" http-equiv=Content-type></head>');
fwrite($f,'<bpdy><table><tr><td>Игрок</td><td>Место</td></tr>');
mysql_query("update turnamuser set place=".(time()+1000)." where place=0 and idturnam=".$tur['id']." and level=".$level);
$sql=mysql_query("select tur.*, us.login from turnamuser as tur left join users as us on us.id=tur.iduser where tur.idturnam=".$tur['id']." order by tur.place desc");
$i=1;
while ($res=mysql_fetch_array($sql)){
if ($i==1 || $i==2 || $i==3){
mysql_query("INSERT INTO `delo`(`id` , `author` ,`pers`, `text`, `type`, `date`) VALUES ('','0','".$res['iduser']."','Выиграл в турнире ".$Priz[$i][$level]." кр.','1','".time()."');");
addchp ('<font color=red>Внимание!</font> За '.$i.' место в турнире, Вы получили '.$Priz[$i][$level].' кр.<BR>','{[]}'.Nick::id($res['iduser'])->short().'{[]}');
}
fwrite($f, '<tr><td>'.$res['login'].'</td><td>'.$i++.'</td></tr>');
}
fwrite($f, '</table></body></html>');
fclose($f);
mysql_query("update turnament set old=2, path='/".$dir."/".$tur['datetime'].".html' where old=0 and level=".$level);
//Раскоментить перед заливкой
//if (mysql_numrows(mysql_query("select id from turnament where old=0"))==0) $this->CreateTournament("Еженедельные турниры");
}
function ShowTournirFinaliats(){
$sql=mysql_query("select datetime,level,path from turnament where old=2 group by level order by datetime");
$level=0;
echo "Результаты прошедших турниров.<br><table border='0' style='background-color:#E0E0E0;'><tr><td>Уровень</td><td>Дата</td></tr>";
while ($res=mysql_fetch_array($sql)){
if ($level!=$res['level']) echo "<tr><td>".$res['level']."</td>";
echo "<td><a href='http://capitalcity.oldbk.com".$res['path']."'>".date("d.m.Y H:i",$res['datetime'])."</a></td>";
if ($level!=$res['level']){
echo "</tr>";
$level=$res['level'];
}
}
echo "</table>";
}
function TournirFinal($level,$masFinals){
mysql_query("update turnamuser set place=0 where (iduser=".$masFinals[0]." or iduser=".$masFinals[1].") and idturnam=(select id from turnament where old=0 and level=".$level.")");
mysql_query("insert into turnirbattle(userid,userid1,level,idtur) values(".$masFinals[0].",".$masFinals[1].",".$level.",(select id from turnament where old=0 and level=".$level."))");
addchp ('<font color=red>Внимание!</font> Подготовтесь к финалу.<BR>','{[]}'.Nick::id($masFinals[0])->short().'{[]}');
addchp ('<font color=red>Внимание!</font> Подготовтесь к финалу.<BR>','{[]}'.Nick::id($masFinals[1])->short().'{[]}');
}
function expectationenemy(){
global $user;
$res=mysql_fetch_array(mysql_query("select * from turnirbattle where userid=".$user['id']." or userid1=".$user['id']." limit 1"));
if ($res['id']!=''){
if ($res['userid']==$user['id'] && $res['checkuser']==0 && $res['badmaxweap']==0){
mysql_query("update turnirbattle set checkuser=1 where userid=".$user['id']);
if ($res['checkuser2']==1){
$battle = $this->MakeBattle($res['userid'],$res['userid1']);
mysql_query("update turnirbattle set battleid=".$battle." where id=".$res['id']);
}
}
elseif($res['badmaxweap']!=0){
if ((time()-$res['badmaxweap'])>120){
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$res['userid']." and idturnam=".$res['idtur']);
mysql_query("delete from turnirbattle where userid=".$res['userid']);
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.Nick::id($res['userid'])->short().'{[]}');
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.Nick::id($res['userid1'])->short().'{[]}');
}
}
if ($res['userid1']==$user['id'] && $res['checkuser2']==0 && $res['badmaxweap1']==0){
mysql_query("update turnirbattle set checkuser2=1 where userid1=".$user['id']);
if ($res['checkuser']==1){
$battle = $this->MakeBattle($res['userid'],$res['userid1']);
mysql_query("update turnirbattle set battleid=".$battle." where id=".$res['id']);
}
}
elseif($res['badmaxweap1']!=0){
if ((time()-$res['badmaxweap1'])>120){
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$res['userid']." and idturnam=".$res['idtur1']);
mysql_query("delete from turnirbattle where userid1=".$res['userid1']);
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.Nick::id($res['userid1'])->short().'{[]}');
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.Nick::id($res['userid'])->short().'{[]}');
}
}
}
}
function StartTournir($level=''){//Запускается в 17-00-10 каждую пятницу
//Разослать всем кнопочки на вход в турнир
global $user;
$res=mysql_fetch_array(mysql_query("select * from turnirbattle where userid=".$user['id']." or userid1=".$user['id']." limit 1"));
$PriceWeap=mysql_fetch_row(mysql_query("select cost from inventory where id=".$user['weap']." limit 1"));
if ($PriceWeap[0]=='') $PriceWeap[0]=0;
if ($PriceWeap[0]>16 || $user['sergi']!=0 || $user['kulon']!=0 || $user['perchi']!=0 || $user['bron']!=0 || $user['r1']!=0 || $user['r2']!=0 || $user['r3']!=0 || $user['helm']!=0 || $user['shit']!=0 || $user['boots']!=0 || $user['stats']!=0 || $user['m1']!=0 || $user['m2']!=0 || $user['m3']!=0 || $user['m4']!=0 || $user['m5']!=0 || $user['m6']!=0 || $user['m7']!=0 || $user['m8']!=0 || $user['m9']!=0 || $user['m10']!=0){
if ($res['userid']==$user['id'] && $res['badmaxweap']==0)
mysql_query("update turnirbattle set badmaxweap=".time()." , checkuser=0 where userid=".$user['id']);
if ($res['userid1']==$user['id'] && $res['badmaxweap1']==0)
mysql_query("update turnirbattle set badmaxweap1=".time()." , checkuser2=0 where userid1=".$user['id']);
addchp ('<font color=red>Внимание!</font>Оставьте оружие только до 16экр или оставьте только оружие.<BR>','{[]}'.Nick::id($user['id'])->short().'{[]}');
}
else{
if ($res['userid']==$user['id']){
mysql_query("update turnirbattle set badmaxweap=0 where userid=".$user['id']);
}
if ($res['userid1']==$user['id']){
mysql_query("update turnirbattle set badmaxweap1=0 where userid1=".$user['id']);
}
}
$sql=mysql_query("select * from turnirbattle where badmaxweap1<>0 or badmaxweap<>0");
while ($res=mysql_fetch_array($sql)){
if ($res['badmaxweap1']!=0){
if ((time()-$res['badmaxweap1'])>120){
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$res['userid1']." and idturnam=".$res['idtur']);
mysql_query("delete from turnirbattle where userid1=".$res['userid1']);
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.Nick::id($res['userid1'])->short().'{[]}');
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.Nick::id($res['userid'])->short().'{[]}');
}
}
if($res['badmaxweap']!=0){
if ((time()-$res['badmaxweap'])>120){
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$res['userid']." and idturnam=".$res['idtur']);
mysql_query("delete from turnirbattle where userid=".$res['userid']);
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.Nick::id($res['userid'])->short().'{[]}');
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.Nick::id($res['userid1'])->short().'{[]}');
}
}
}
if ($level!='') $level=' and level='.$level;
$sql=mysql_query("SELECT * FROM turnirbattle WHERE (userid=".$user['id']." or userid1=".$user['id'].") ".$level);
while ($res=mysql_fetch_array($sql)){
$looseL1=mysql_fetch_row(mysql_query("select loose from turnamuser where iduser=".$res['userid1']." and idturnam=".$res['idtur']));
$looseL=mysql_fetch_row(mysql_query("select loose from turnamuser where iduser=".$res['userid']." and idturnam=".$res['idtur']));
if ($res['userid']==$user['id']) {
if($res['checkuser']==0){
if($res['badmaxweap']!=0){
if ((time()-$res['badmaxweap'])>120){
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$res['userid']." and idturnam=".$res['idtur']);
mysql_query("delete from turnirbattle where userid=".$res['userid']);
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.Nick::id($res['userid'])->short().'{[]}');
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.Nick::id($res['userid1'])->short().'{[]}');
}
else echo "<form method='post'><input type='submit' name='expenemy' value='Я готов'> противник ".Nick::id($res['useridl'])->full(1)."(поражений-".$looseL1[0].")</form>";
}
else echo "<form method='post'><input type='submit' name='expenemy' value='Я готов'> противник ".Nick::id($res['useridl'])->full(1)."(поражений-".$looseL1[0].")</form>";
}
else echo "Ожидаем противника";
}
if ($res['userid1']==$user['id']){
if ($res['checkuser2']==0){
if($res['badmaxweap1']!=0){
if ((time()-$res['badmaxweap1'])>120){
mysql_query("update turnamuser set loose=2, place=".time()." where iduser=".$res['userid1']." and idturnam=".$res['idtur']);
mysql_query("delete from turnirbattle where userid1=".$res['userid1']);
addchp ('<font color=red>Внимание!</font>Вы выбыли из турнира<BR>','{[]}'.Nick::id($res['userid1'])->short().'{[]}');
addchp ('<font color=red>Внимание!</font>Ваш противник отказался от боя. Техническая победа.<BR>','{[]}'.Nick::id($res['userid'])->short().'{[]}');
}
else echo "<form method='post'><input type='submit' name='expenemy' value='Я готов'>противник ".Nick::id($res['userid'])->full(1)."(поражений-".$looseL[0].")</form>";
}
else echo "<form method='post'><input type='submit' name='expenemy' value='Я готов'>противник ".Nick::id($res['userid'])->full(1)."(поражений-".$looseL[0].")</form>";
}
else echo "Ожидаем противника";
}
}
}
function CreateTournament($title){
//Вычисляем следующую пятницу
$dateTime='';
if (date("w", mktime(0, 0, 0, date('n'), date('j'), date('Y')))==5 && date("H")>17){
$nextDay=date('j')+1;
$DayofMonth=date('j');
if ($nextDay>date('t')) {
$nextDay=1;
$DayofMonth=date("t",mktime(0, 0, 0, date('n')+1, 1, date('Y')));//даже если date('n')+1 = 13 mktime переведет на 01.01.следующий год
}
}
else{
$nextDay=date('j');
$DayofMonth=date('t');
}
for ($j=$nextDay;$j<=$DayofMonth;$j++){
//узнаем день недели
$DayofWeek=date("w", mktime(0, 0, 0, date('n'), $j, date('Y')));
if ($DayofWeek==5){
$dateTime=mktime(17, 0, 0, date('n'), $j, date('Y'));
break;
}
}
//если пятниц в этом месяце не осталось
if ($dateTime==''){
if (date("n")+1==13){
$Month=1;
$Year=date("Y")+1;
}
else {
$Month=date('n')+1;
$Year=date("Y");
}
for ($j=1;$j<=date('t',mktime(0, 0, 0, $Month, 1, $Year));$j++){
//узнаем день недели
$DayofWeek=date("w", mktime(0, 0, 0, $Month, $j, $Year));
if ($DayofWeek==5){
$dateTime=mktime(17, 0, 0, $Month, $j, $Year);
break;
}
}
}
//Создаем турниры.
for ($i=1;$i<$this->MaxUserLevel;$i++)
if (!mysql_query("insert into turnament(title,level,datetime) values ('".$title."',".$i.",'".$dateTime."')")){
//!!!!!!!!!!!!!!!!!!! failed to open stream: Permission denied in /www/capitalcity.oldbk.com/classturnir.php on line 57
$f=fopen('/tmp/memcache/logtur/error.log','w');
fwrite($f, "insert into turnament(title,level,datetime) values ('".$title."',".$i.",'".$dateTime."')\n");
fclose($f);
}
}
function showAllTurnament(){
global $user;
$sql=mysql_query("select * from turnament where old=0");
$dateD=mysql_fetch_row(mysql_query("select datetime from turnament where old=0 limit 1"));
if (mysql_num_rows($sql)<1) echo("На данный момент новых чемпионатов нет");
if ($user['level']>0 && mktime()<$dateD[0])
echo "<form method='post'>";
echo "<table border=1 style='font-weight:bold;'>
<tr>
<td>Название турнира</td>
<td>Время проведения</td>
<td>Кол-во учасников</td>
<td>Уровень</td>";
if ($user['level']>0 && mktime()<$dateD[0])
echo "<td>Регистрация</td>";
echo "</tr>";
while ($res=mysql_fetch_array($sql)){
if ($user['level']==$res['level'])
$dellzay=mysql_fetch_row(mysql_query("select id from turnamuser where iduser=".$user['id']." and idturnam=".$res['id']));
echo "<tr>
<td>
".$res['title']."
</td>
<td>
".date("d.m.Y H:i",$res['datetime'])."
</td>
<td>
".$res['kolvo']."
</td>
<td>
".$res['level']."
</td>";
if ($user['level']==$res['level'] && mktime()<$dateD[0]){
if ($dellzay[0]=='')
echo "<td>
<input type='submit' name='addzayvka' value='Зарегистрироваться'>
<input type='hidden' name='idtur' value='".$res['id']."'>
</td>";
else
echo "<td>
<input type='submit' name='dellzayvka' value='Отказаться'>
<input type='hidden' name='idtur' value='".$res['id']."'>
</td>";
}
echo "</tr>";
}
echo "</table>";
if ($user['level']>0 && mktime()<$dateD[0])
echo "</form>";
}
}

View File

@ -1,19 +1,23 @@
<?php
session_start();
if ($_SESSION['uid'] == null) header("Location: index.php");
if (!$_SESSION['uid']) {
header("Location: index.php");
exit;
}
require_once 'functions.php';
$user = $user ?? 0;
if ($user['level'] < 1) {
if ($user->level < 1) {
header("Location: main.php");
die();
exit;
}
if ($user['room'] != 25) {
if ($user->room != 25) {
header("Location: main.php");
die();
exit;
}
if ($user['battle'] != 0) {
if ($user->battle) {
header('location: fbattle.php');
die();
exit;
}
$get = urldecode(filter_input(INPUT_SERVER, 'QUERY_STRING'));

View File

@ -206,4 +206,5 @@ trait Config
1250000000 => [1, 0, 0, 450, 0, 1500000000],
1500000000 => [10, 1, 5, 8000, 1, 9999999999], # Это тринадцатый уровень
];
public static $cavedata = [621 => ['x1' => 6, 'y1' => 11, 'dir1' => 1, 'x2' => 10, 'y2' => 8, 'dir2' => 1, 'x3' => 20, 'y3' => 4, 'dir3' => 1, 'x4' => 10, 'y4' => 10, 'dir4' => 1, 'delay' => 360, 'name1' => 'Проклятый Рудник', 'name2' => 'Проклятого Рудника']];
}

Some files were not shown because too many files have changed in this diff Show More