주사위를 삭제하고 스탯을 직접 입력하도록 변경
This commit is contained in:
@@ -31,8 +31,6 @@ if(isTable($connect, "nation", $dbname)) @MYDB_query("drop table nation", $conne
|
|||||||
if(isTable($connect, "city", $dbname)) @MYDB_query("drop table city", $connect) or Error("drop ".MYDB_error($connect),"");
|
if(isTable($connect, "city", $dbname)) @MYDB_query("drop table city", $connect) or Error("drop ".MYDB_error($connect),"");
|
||||||
// 부대 테이블 삭제
|
// 부대 테이블 삭제
|
||||||
if(isTable($connect, "troop", $dbname)) @MYDB_query("drop table troop", $connect) or Error("drop ".MYDB_error($connect),"");
|
if(isTable($connect, "troop", $dbname)) @MYDB_query("drop table troop", $connect) or Error("drop ".MYDB_error($connect),"");
|
||||||
// 토큰 테이블 삭제
|
|
||||||
if(isTable($connect, "token",$dbname)) @MYDB_query("drop table token", $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
// 외교 테이블 삭제
|
// 외교 테이블 삭제
|
||||||
if(isTable($connect, "diplomacy", $dbname)) @MYDB_query("drop table diplomacy", $connect) or Error("drop ".MYDB_error($connect),"");
|
if(isTable($connect, "diplomacy", $dbname)) @MYDB_query("drop table diplomacy", $connect) or Error("drop ".MYDB_error($connect),"");
|
||||||
// 토너먼트 테이블 삭제
|
// 토너먼트 테이블 삭제
|
||||||
@@ -56,8 +54,6 @@ if(!isTable($connect, "nation", $dbname)) @MYDB_query($nation_schema, $connect)
|
|||||||
if(!isTable($connect, "city", $dbname)) @MYDB_query($city_schema, $connect) or Error("create city ".MYDB_error($connect),"");
|
if(!isTable($connect, "city", $dbname)) @MYDB_query($city_schema, $connect) or Error("create city ".MYDB_error($connect),"");
|
||||||
// 부대 테이블 생성
|
// 부대 테이블 생성
|
||||||
if(!isTable($connect, "troop", $dbname)) @MYDB_query($troop_schema, $connect) or Error("create troop ".MYDB_error($connect),"");
|
if(!isTable($connect, "troop", $dbname)) @MYDB_query($troop_schema, $connect) or Error("create troop ".MYDB_error($connect),"");
|
||||||
// 토큰 테이블 생성
|
|
||||||
if(!isTable($connect, "token",$dbname)) @MYDB_query($token_schema, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
// 외교 테이블 생성
|
// 외교 테이블 생성
|
||||||
if(!isTable($connect, "diplomacy", $dbname)) @MYDB_query($diplomacy_schema, $connect) or Error("create diplomacy ".MYDB_error($connect),"");
|
if(!isTable($connect, "diplomacy", $dbname)) @MYDB_query($diplomacy_schema, $connect) or Error("create diplomacy ".MYDB_error($connect),"");
|
||||||
// 전당 테이블 생성
|
// 전당 테이블 생성
|
||||||
|
|||||||
+135
-62
@@ -21,28 +21,6 @@ if(!$member) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$connect = dbConn();
|
$connect = dbConn();
|
||||||
|
|
||||||
$abil = abilityRand();
|
|
||||||
|
|
||||||
//토큰 테이블에서 정보확인
|
|
||||||
$query = "select id from token where id='{$id}'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$token = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
if(!$token) {
|
|
||||||
//능력치 토큰 생성
|
|
||||||
$query = "
|
|
||||||
insert into token (
|
|
||||||
id, leader, power, intel
|
|
||||||
) values (
|
|
||||||
'{$id}', {$abil['leader']}, {$abil['power']}, {$abil['intel']}
|
|
||||||
)";
|
|
||||||
$result = MYDB_query($query,$connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
} else {
|
|
||||||
$query = "update token set leader={$abil['leader']},power={$abil['power']},intel={$abil['intel']} where id='{$id}'";
|
|
||||||
MYDB_query($query, $connect) or Error("join_post ".MYDB_error($connect),"");
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
@@ -53,50 +31,145 @@ if(!$token) {
|
|||||||
<script type="text/javascript" src="jquery-1.11.0.min.js"></script>
|
<script type="text/javascript" src="jquery-1.11.0.min.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
function updateToken(type) {
|
jQuery(function($){
|
||||||
var id = $("#id").val();
|
|
||||||
var pw = $("#pw").val();
|
var totalAbil = 150;
|
||||||
|
var $leader = $('#leader');
|
||||||
|
var $power = $('#power');
|
||||||
|
var $intel = $('#intel');
|
||||||
|
|
||||||
$.ajax({
|
function abilityRand(){
|
||||||
type: "POST",
|
var leader = Math.random()*65 + 10;
|
||||||
url: "join_token.php",
|
var power = Math.random()*65 + 10;
|
||||||
async: false,
|
var intel = Math.random()*65 + 10;
|
||||||
data: { id: id, pw: pw, type: type },
|
var rate = leader + power + intel;
|
||||||
success: function(data, textStatus, jqXHR) {
|
|
||||||
console.log(data);
|
leader = Math.floor(leader / rate * totalAbil);
|
||||||
if(data.result != "rand" && data.result != "leadpow" && data.result != "leadint" && data.result != "powint") {
|
power = Math.floor(power / rate * totalAbil);
|
||||||
alert(jqXHR.status+", "+jqXHR.statusText+", "+jqXHR.responseText);
|
intel = Math.floor(intel / rate * totalAbil);
|
||||||
location.replace("index.php");
|
|
||||||
} else {
|
|
||||||
$("#leader").text(data.leader);
|
while(leader+power+intel < totalAbil){
|
||||||
$("#power").text(data.power);
|
leader+=1;
|
||||||
$("#intel").text(data.intel);
|
}
|
||||||
}
|
|
||||||
},
|
if(leader > 75 || power > 75 || intel > 75 || leader < 10 || power < 10 || intel < 10){
|
||||||
dataType: 'json',
|
return abilityRand();
|
||||||
error: function(jqXHR, textStatus, errorThrown) {
|
|
||||||
alert(jqXHR.status+", "+jqXHR.statusText+", "+jqXHR.responseText);
|
|
||||||
location.replace("index.php");
|
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function abilityRand() {
|
$leader.val(leader);
|
||||||
updateToken("rand");
|
$power.val(power);
|
||||||
}
|
$intel.val(intel);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function abilityLeadpow() {
|
function abilityLeadpow(){
|
||||||
updateToken("leadpow");
|
var leader = Math.random() * 6;
|
||||||
}
|
var power = Math.random() * 6;
|
||||||
|
var intel = Math.random() * 1;
|
||||||
|
var rate = leader + power + intel;
|
||||||
|
|
||||||
function abilityLeadint() {
|
leader = Math.floor(leader / rate * totalAbil);
|
||||||
updateToken("leadint");
|
power = Math.floor(power / rate * totalAbil);
|
||||||
}
|
intel = Math.floor(intel / rate * totalAbil);
|
||||||
|
|
||||||
|
while(leader+power+intel < totalAbil){
|
||||||
|
power+=1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(intel < 10){
|
||||||
|
leader -= 10 - intel;
|
||||||
|
intel = 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(leader > 75){
|
||||||
|
power += leader - 75;
|
||||||
|
leader = 75;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(power > 75){
|
||||||
|
leader += power - 75;
|
||||||
|
power = 75;
|
||||||
|
}
|
||||||
|
|
||||||
function abilityPowint() {
|
$leader.val(leader);
|
||||||
updateToken("powint");
|
$power.val(power);
|
||||||
}
|
$intel.val(intel);
|
||||||
|
}
|
||||||
|
|
||||||
|
function abilityLeadint(){
|
||||||
|
var leader = Math.random() * 6;
|
||||||
|
var power = Math.random() * 1;
|
||||||
|
var intel = Math.random() * 6;
|
||||||
|
var rate = leader + power + intel;
|
||||||
|
|
||||||
|
leader = Math.floor(leader / rate * totalAbil);
|
||||||
|
power = Math.floor(power / rate * totalAbil);
|
||||||
|
intel = Math.floor(intel / rate * totalAbil);
|
||||||
|
|
||||||
|
while(leader+power+intel < totalAbil){
|
||||||
|
intel+=1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(power < 10){
|
||||||
|
leader -= 10 - power;
|
||||||
|
power = 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(leader > 75){
|
||||||
|
intel += leader - 75;
|
||||||
|
leader = 75;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(intel > 75){
|
||||||
|
leader += intel - 75;
|
||||||
|
intel = 75;
|
||||||
|
}
|
||||||
|
|
||||||
|
$leader.val(leader);
|
||||||
|
$power.val(power);
|
||||||
|
$intel.val(intel);
|
||||||
|
}
|
||||||
|
|
||||||
|
function abilityPowint(){
|
||||||
|
var leader = Math.random() * 1;
|
||||||
|
var power = Math.random() * 6;
|
||||||
|
var intel = Math.random() * 6;
|
||||||
|
var rate = leader + power + intel;
|
||||||
|
|
||||||
|
leader = Math.floor(leader / rate * totalAbil);
|
||||||
|
power = Math.floor(power / rate * totalAbil);
|
||||||
|
intel = Math.floor(intel / rate * totalAbil);
|
||||||
|
|
||||||
|
while(leader+power+intel < totalAbil){
|
||||||
|
intel+=1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(leader < 10){
|
||||||
|
power -= 10 - leader;
|
||||||
|
leader = 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(power > 75){
|
||||||
|
intel += power - 75;
|
||||||
|
power = 75;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(intel > 75){
|
||||||
|
power += intel - 75;
|
||||||
|
intel = 75;
|
||||||
|
}
|
||||||
|
|
||||||
|
$leader.val(leader);
|
||||||
|
$power.val(power);
|
||||||
|
$intel.val(intel);
|
||||||
|
}
|
||||||
|
|
||||||
|
window.abilityRand = abilityRand;
|
||||||
|
window.abilityLeadpow = abilityLeadpow;
|
||||||
|
window.abilityLeadint = abilityLeadint;
|
||||||
|
window.abilityPowint = abilityPowint;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<? require('analytics.php'); ?>
|
<? require('analytics.php'); ?>
|
||||||
</head>
|
</head>
|
||||||
@@ -200,15 +273,15 @@ if($admin[img] >= 1 && $member[grade] >= 1 && $member[picture] != "") {
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=498 align=right id=bg1>통솔</td>
|
<td width=498 align=right id=bg1>통솔</td>
|
||||||
<td colspan=2><font id=leader><?=$abil['leader'];?></font></td>
|
<td colspan=2><input type="text" onkeypress='return event.charCode >= 48 && event.charCode <= 57' name="leader" id="leader" value="50"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=498 align=right id=bg1>무력</td>
|
<td width=498 align=right id=bg1>무력</td>
|
||||||
<td colspan=2><font id=power><?=$abil['power'];?></font></td>
|
<td colspan=2><input type="text" onkeypress='return event.charCode >= 48 && event.charCode <= 57' name="power" id="power" value="50"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=498 align=right id=bg1>지력</td>
|
<td width=498 align=right id=bg1>지력</td>
|
||||||
<td colspan=2><font id=intel><?=$abil['intel'];?></font></td>
|
<td colspan=2><input type="text" onkeypress='return event.charCode >= 48 && event.charCode <= 57' name="intel" id="intel" value="50"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=498 align=right id=bg1>능력치 조정</td>
|
<td width=498 align=right id=bg1>능력치 조정</td>
|
||||||
|
|||||||
+3
-21
@@ -9,6 +9,9 @@ $name = _String::NoSpecialCharacter($name);
|
|||||||
$pic = $_POST[pic];
|
$pic = $_POST[pic];
|
||||||
$character = $_POST[character];
|
$character = $_POST[character];
|
||||||
|
|
||||||
|
$leader = floor($_POST['leader']);
|
||||||
|
$power = floor($_POST['power']);
|
||||||
|
$intel = floor($_POST['intel']);
|
||||||
$pwTemp = substr($pw, 0, 32);
|
$pwTemp = substr($pw, 0, 32);
|
||||||
|
|
||||||
$connect = dbConn("sammo");
|
$connect = dbConn("sammo");
|
||||||
@@ -49,21 +52,6 @@ $query = "select no from general where name='$name'";
|
|||||||
$result = MYDB_query($query,$connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query,$connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$name_num = MYDB_num_rows($result);
|
$name_num = MYDB_num_rows($result);
|
||||||
|
|
||||||
$query = "select * from token where id='$member[id]'";
|
|
||||||
$result = MYDB_query($query,$connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$token_num = MYDB_num_rows($result);
|
|
||||||
|
|
||||||
if($token_num == 1) {
|
|
||||||
$token = MYDB_fetch_array($result);
|
|
||||||
$leader = $token['leader'];
|
|
||||||
$power = $token['power'];
|
|
||||||
$intel = $token['intel'];
|
|
||||||
} else {
|
|
||||||
$leader = 0;
|
|
||||||
$power = 0;
|
|
||||||
$intel = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($id_num) {
|
if($id_num) {
|
||||||
echo("<script>
|
echo("<script>
|
||||||
window.alert('이미 등록하셨습니다!')
|
window.alert('이미 등록하셨습니다!')
|
||||||
@@ -76,12 +64,6 @@ if($id_num) {
|
|||||||
history.go(-1)
|
history.go(-1)
|
||||||
</script>");
|
</script>");
|
||||||
exit;
|
exit;
|
||||||
} elseif($token_num != 1) {
|
|
||||||
echo("<script>
|
|
||||||
window.alert('능력치 정보가 잘못되었습니다. 운영자에게 문의해 주세요!')
|
|
||||||
history.go(-1)
|
|
||||||
</script>");
|
|
||||||
exit;
|
|
||||||
} elseif($admin[maxgeneral] <= $gencount) {
|
} elseif($admin[maxgeneral] <= $gencount) {
|
||||||
echo("<script>
|
echo("<script>
|
||||||
window.alert('더이상 등록할 수 없습니다!')
|
window.alert('더이상 등록할 수 없습니다!')
|
||||||
|
|||||||
@@ -1,58 +0,0 @@
|
|||||||
<?
|
|
||||||
include "lib.php";
|
|
||||||
include "func.php";
|
|
||||||
|
|
||||||
$id = $_POST[id];
|
|
||||||
$pw = $_POST[pw];
|
|
||||||
$type = $_POST[type];
|
|
||||||
|
|
||||||
$pwTemp = substr($pw, 0, 32);
|
|
||||||
|
|
||||||
$connect = dbConn("sammo");
|
|
||||||
|
|
||||||
//회원 테이블에서 정보확인
|
|
||||||
$query = "select no,id,picture,imgsvr,grade from MEMBER where id='$id' and pw='$pwTemp'";
|
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
$member = MYDB_fetch_array($result);
|
|
||||||
|
|
||||||
$connect = dbConn();
|
|
||||||
|
|
||||||
if(!$member) {
|
|
||||||
$response['result'] = "error";
|
|
||||||
echo json_encode($response);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($type == "rand") {
|
|
||||||
$response['result'] = "rand";
|
|
||||||
|
|
||||||
$abil = abilityRand();
|
|
||||||
} elseif($type == "leadpow") {
|
|
||||||
$response['result'] = "leadpow";
|
|
||||||
|
|
||||||
$abil = abilityLeadpow();
|
|
||||||
} elseif($type == "leadint") {
|
|
||||||
$response['result'] = "leadint";
|
|
||||||
|
|
||||||
$abil = abilityLeadint();
|
|
||||||
} elseif($type == "powint") {
|
|
||||||
$response['result'] = "powint";
|
|
||||||
|
|
||||||
$abil = abilityPowint();
|
|
||||||
} else {
|
|
||||||
$response['result'] = "error";
|
|
||||||
echo json_encode($response);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
$query = "update token set leader={$abil['leader']},power={$abil['power']},intel={$abil['intel']} where id='{$id}'";
|
|
||||||
MYDB_query($query, $connect) or Error("join_post ".MYDB_error($connect),"");
|
|
||||||
|
|
||||||
$response['leader'] = $abil['leader'];
|
|
||||||
$response['power'] = $abil['power'];
|
|
||||||
$response['intel'] = $abil['intel'];
|
|
||||||
|
|
||||||
usleep(100*1000);
|
|
||||||
echo json_encode($response);
|
|
||||||
|
|
||||||
?>
|
|
||||||
@@ -51,8 +51,6 @@ if(isTable($connect, "nation",$dbname)) @MYDB_query("drop table nation", $connec
|
|||||||
if(isTable($connect, "city",$dbname)) @MYDB_query("drop table city", $connect) or Error(__LINE__.MYDB_error($connect),"");
|
if(isTable($connect, "city",$dbname)) @MYDB_query("drop table city", $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
// 부대 테이블 삭제
|
// 부대 테이블 삭제
|
||||||
if(isTable($connect, "troop",$dbname)) @MYDB_query("drop table troop", $connect) or Error(__LINE__.MYDB_error($connect),"");
|
if(isTable($connect, "troop",$dbname)) @MYDB_query("drop table troop", $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
// 토큰 테이블 삭제
|
|
||||||
if(isTable($connect, "token",$dbname)) @MYDB_query("drop table token", $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
// 외교 테이블 삭제
|
// 외교 테이블 삭제
|
||||||
if(isTable($connect, "diplomacy",$dbname)) @MYDB_query("drop table diplomacy", $connect) or Error(__LINE__.MYDB_error($connect),"");
|
if(isTable($connect, "diplomacy",$dbname)) @MYDB_query("drop table diplomacy", $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
// 토너먼트 테이블 삭제
|
// 토너먼트 테이블 삭제
|
||||||
@@ -74,8 +72,6 @@ if(!isTable($connect, "nation",$dbname)) @MYDB_query($nation_schema, $connect) o
|
|||||||
if(!isTable($connect, "city",$dbname)) @MYDB_query($city_schema, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
if(!isTable($connect, "city",$dbname)) @MYDB_query($city_schema, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
// 부대 테이블 생성
|
// 부대 테이블 생성
|
||||||
if(!isTable($connect, "troop",$dbname)) @MYDB_query($troop_schema, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
if(!isTable($connect, "troop",$dbname)) @MYDB_query($troop_schema, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
// 토큰 테이블 생성
|
|
||||||
if(!isTable($connect, "token",$dbname)) @MYDB_query($token_schema, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
// 외교 테이블 생성
|
// 외교 테이블 생성
|
||||||
if(!isTable($connect, "diplomacy",$dbname)) @MYDB_query($diplomacy_schema, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
if(!isTable($connect, "diplomacy",$dbname)) @MYDB_query($diplomacy_schema, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
// 전당 테이블 생성
|
// 전당 테이블 생성
|
||||||
|
|||||||
@@ -298,25 +298,6 @@ $troop_schema = "
|
|||||||
|
|
||||||
";
|
";
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
// 토큰 테이블
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
$token_schema = "
|
|
||||||
|
|
||||||
create table token (
|
|
||||||
token int(6) not null auto_increment,
|
|
||||||
id char(16) not null,
|
|
||||||
leader int(3) not null,
|
|
||||||
power int(3) not null,
|
|
||||||
intel int(3) not null,
|
|
||||||
|
|
||||||
PRIMARY KEY (token),
|
|
||||||
KEY(id)
|
|
||||||
) ENGINE=INNODB ROW_FORMAT=DYNAMIC DEFAULT CHARSET=UTF8
|
|
||||||
|
|
||||||
";
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// 락 테이블
|
// 락 테이블
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user