Hengband  2.2.1
データ構造 | マクロ定義 | 関数 | 変数
report.c ファイル

スコアサーバ転送機能の実装 [詳解]

#include "angband.h"
#include "util.h"
#include "core.h"
#include "inet.h"
#include "dungeon.h"
#include "floor.h"
#include "player-status.h"
#include "player-class.h"
#include "player-race.h"
#include "player-personality.h"
#include "files.h"
#include "world.h"
#include "realm.h"
#include "term.h"
#include "view-mainwindow.h"
#include <stdio.h>
#include <stdarg.h>
#include <ctype.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sys/time.h>
#include <setjmp.h>
#include <signal.h>
report.c の依存先関係図:

データ構造

struct  BUF
 

マクロ定義

#define _GNU_SOURCE
 未使用 [詳解]
 
#define HTTP_PROXY   ""
 デフォルトのプロキシURL / Default proxy url [詳解]
 
#define HTTP_PROXY_PORT   0
 デフォルトのプロキシポート / Default proxy port [詳解]
 
#define HTTP_TIMEOUT   20
 デフォルトのタイムアウト時間(秒) / Timeout length (second) [詳解]
 
#define SCORE_SERVER   "hengband.osdn.jp"
 デフォルトのスコアサーバURL / Default score server url [詳解]
 
#define SCORE_PORT   80
 デフォルトのスコアサーバポート / Default score server port [詳解]
 
#define SCORE_PATH   "http://moon.kmc.gr.jp/hengband/hengscore-en/score.cgi"
 スコア開示URL [詳解]
 
#define BUFSIZE   (65536)
 スコアサーバ転送バッファサイズ [詳解]
 

関数

static BUFbuf_new (void)
 転送用バッファの確保 [詳解]
 
static void buf_delete (BUF *b)
 転送用バッファの解放 [詳解]
 
static int buf_append (BUF *buf, concptr data, size_t size)
 転送用バッファにデータを追加する [詳解]
 
static int buf_sprintf (BUF *buf, concptr fmt,...)
 転送用バッファにフォーマット指定した文字列データを追加する [詳解]
 
static bool http_post (int sd, concptr url, BUF *buf)
 HTTPによるダンプ内容伝送 [詳解]
 
static errr make_dump (BUF *dumpbuf)
 キャラクタダンプを作って BUFに保存 [詳解]
 
concptr make_screen_dump (void)
 スクリーンダンプを作成する/ Make screen dump to buffer [詳解]
 
errr report_score (void)
 スコア転送処理のメインルーチン [詳解]
 

変数

concptr screen_dump = NULL
 

詳解

スコアサーバ転送機能の実装

日付
2014/07/14
著者
Hengband Team

マクロ定義詳解

◆ _GNU_SOURCE

#define _GNU_SOURCE

未使用

◆ BUFSIZE

#define BUFSIZE   (65536)

スコアサーバ転送バッファサイズ

◆ HTTP_PROXY

#define HTTP_PROXY   ""

デフォルトのプロキシURL / Default proxy url

◆ HTTP_PROXY_PORT

#define HTTP_PROXY_PORT   0

デフォルトのプロキシポート / Default proxy port

◆ HTTP_TIMEOUT

#define HTTP_TIMEOUT   20

デフォルトのタイムアウト時間(秒) / Timeout length (second)

◆ SCORE_PATH

#define SCORE_PATH   "http://moon.kmc.gr.jp/hengband/hengscore-en/score.cgi"

スコア開示URL

◆ SCORE_PORT

#define SCORE_PORT   80

デフォルトのスコアサーバポート / Default score server port

◆ SCORE_SERVER

#define SCORE_SERVER   "hengband.osdn.jp"

デフォルトのスコアサーバURL / Default score server url

関数詳解

◆ buf_append()

static int buf_append ( BUF buf,
concptr  data,
size_t  size 
)
static

転送用バッファにデータを追加する

引数
buf追加先バッファの参照ポインタ
data追加元データ
size追加サイズ
戻り値
追加後のバッファ容量
被呼び出し関係図:

◆ buf_delete()

static void buf_delete ( BUF b)
static

転送用バッファの解放

引数
b解放するバッファの参照ポインタ
被呼び出し関係図:

◆ buf_new()

static BUF* buf_new ( void  )
static

転送用バッファの確保

戻り値
確保したバッファの参照ポインタ
被呼び出し関係図:

◆ buf_sprintf()

static int buf_sprintf ( BUF buf,
concptr  fmt,
  ... 
)
static

転送用バッファにフォーマット指定した文字列データを追加する

引数
buf追加先バッファの参照ポインタ
fmt文字列フォーマット
戻り値
追加後のバッファ容量
呼び出し関係図:
被呼び出し関係図:

◆ http_post()

static bool http_post ( int  sd,
concptr  url,
BUF buf 
)
static

HTTPによるダンプ内容伝送

引数
sdソケットID
url伝送先URL
buf伝送内容バッファ
戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ make_dump()

static errr make_dump ( BUF dumpbuf)
static

キャラクタダンプを作って BUFに保存

引数
dumpbuf伝送内容バッファ
戻り値
エラーコード
呼び出し関係図:
被呼び出し関係図:

◆ make_screen_dump()

concptr make_screen_dump ( void  )

スクリーンダンプを作成する/ Make screen dump to buffer

戻り値
作成したスクリーンダンプの参照ポインタ
呼び出し関係図:
被呼び出し関係図:

◆ report_score()

errr report_score ( void  )

スコア転送処理のメインルーチン

戻り値
エラーコード
呼び出し関係図:
被呼び出し関係図:

変数詳解

◆ screen_dump

concptr screen_dump = NULL