mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Cleaned up old unused files (#31882)
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
511.1378
|
|
||||||
1
.github/ISSUE_TEMPLATE.md
vendored
1
.github/ISSUE_TEMPLATE.md
vendored
@@ -65,7 +65,6 @@ goonchat = "Goonchat"
|
|||||||
grammar = "Grammar / Formatting"
|
grammar = "Grammar / Formatting"
|
||||||
help = "help wanted"
|
help = "help wanted"
|
||||||
hotfix = "Hotfix"
|
hotfix = "Hotfix"
|
||||||
libvg = "libvg"
|
|
||||||
logging = "Logging / Administration"
|
logging = "Logging / Administration"
|
||||||
meta = "Mapping (Meta :no_mobile_phones:)"
|
meta = "Mapping (Meta :no_mobile_phones:)"
|
||||||
needspritework = "Needs Spritework"
|
needspritework = "Needs Spritework"
|
||||||
|
|||||||
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -41,7 +41,6 @@ goonchat = "Goonchat"
|
|||||||
grammar = "Grammar / Formatting"
|
grammar = "Grammar / Formatting"
|
||||||
help = "help wanted"
|
help = "help wanted"
|
||||||
hotfix = "Hotfix"
|
hotfix = "Hotfix"
|
||||||
libvg = "libvg"
|
|
||||||
logging = "Logging / Administration"
|
logging = "Logging / Administration"
|
||||||
meta = "Mapping (Meta :no_mobile_phones:)"
|
meta = "Mapping (Meta :no_mobile_phones:)"
|
||||||
needspritework = "Needs Spritework"
|
needspritework = "Needs Spritework"
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -75,8 +75,5 @@ cfg
|
|||||||
# Thumbs.db (windows image caching)
|
# Thumbs.db (windows image caching)
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
# Linux users can compile this themselves
|
|
||||||
libvg.so
|
|
||||||
|
|
||||||
# Bootstrapped node installation for the tgui build system
|
# Bootstrapped node installation for the tgui build system
|
||||||
.cache
|
.cache
|
||||||
|
|||||||
15
COPYRIGHT
15
COPYRIGHT
@@ -1,15 +0,0 @@
|
|||||||
Baystation12
|
|
||||||
Copyright (C) 2010-2013 Baystation12 and tgstation13.
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
@@ -64,10 +64,6 @@ where the BYOND key must be in lowercase and the admin rank must be properly cap
|
|||||||
|
|
||||||
Finally, to start the server, run Dream Daemon and enter the path to your compiled vgstation13.dmb file. Make sure to set the port to the one you specified in the config.txt, and set the Security box to 'Trusted'. Then press GO and the server should start up and be ready to join.
|
Finally, to start the server, run Dream Daemon and enter the path to your compiled vgstation13.dmb file. Make sure to set the port to the one you specified in the config.txt, and set the Security box to 'Trusted'. Then press GO and the server should start up and be ready to join.
|
||||||
|
|
||||||
#### Linux
|
|
||||||
|
|
||||||
We use a Rust library called `libvg` to handle some things like UTF-8 handling. A Windows build is shipped with the code (`libvg.dll`), however a Linux version is not. If you want to run /vg/station13 on Linux, you will have to compile this binary yourself (or ask for a build on Discord). See [`libvg/readme.md`](libvg/README.md) for details on how to compile it.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### Configuration
|
### Configuration
|
||||||
|
|||||||
@@ -402,8 +402,6 @@
|
|||||||
|
|
||||||
#define subtypesof(A) (typesof(A) - A)
|
#define subtypesof(A) (typesof(A) - A)
|
||||||
|
|
||||||
#define LIBVG(function, arguments...) call("./libvg.[world.system_type == UNIX ? "so" : "dll"]", function)(arguments)
|
|
||||||
|
|
||||||
// For areas that are on the map, `x` is the coordinate of the turf with the lowest z, y, and x coordinate (in that order) that is contained by the area.
|
// For areas that are on the map, `x` is the coordinate of the turf with the lowest z, y, and x coordinate (in that order) that is contained by the area.
|
||||||
#define is_area_in_map(A) (A.x)
|
#define is_area_in_map(A) (A.x)
|
||||||
|
|
||||||
|
|||||||
@@ -1,71 +0,0 @@
|
|||||||
# INDENTATION IS IMPORTANT. Indent with 2 spaces or you'll break stuff.
|
|
||||||
# This is a comment because it has a hashmark in front of it. YAML doesn't care about comments.
|
|
||||||
|
|
||||||
# Names the bot responds to.
|
|
||||||
# List of strings corresponding to whatever horrible nicknames you decide to call it.
|
|
||||||
names: [
|
|
||||||
'nt',
|
|
||||||
'vg',
|
|
||||||
'VGTestServer'
|
|
||||||
]
|
|
||||||
# Currently only supports one server.
|
|
||||||
servers:
|
|
||||||
# Hostname or IP of the server
|
|
||||||
irc.yourserver.tld:
|
|
||||||
# Nickname of the bot, automatically gets underscores slapped onto the end if it can't connect with that nick.
|
|
||||||
# Also becomes the realname of the bot.
|
|
||||||
nick: 'NanotrasenBot'
|
|
||||||
|
|
||||||
# Password of the SERVER. You probably don't need this.
|
|
||||||
password: null
|
|
||||||
|
|
||||||
# Port, leave this alone unless you know what you're doing.
|
|
||||||
port: 6667
|
|
||||||
|
|
||||||
# Channels the bot will join.
|
|
||||||
channels:
|
|
||||||
# Channel to join.
|
|
||||||
"#vgstation":
|
|
||||||
# Channel password (+k). Can be safely omitted.
|
|
||||||
password: null
|
|
||||||
|
|
||||||
# Flags go here. This one means non-ahelp nudges will be sent to this channel.
|
|
||||||
nudges: true
|
|
||||||
"#vgstation-admins":
|
|
||||||
# This one means adminhelps will be sent.
|
|
||||||
ahelps: true
|
|
||||||
|
|
||||||
# Plugin options, to keep things tidy.
|
|
||||||
plugins:
|
|
||||||
# Nudge processing options. Comment out this block to disable nudge support.
|
|
||||||
nudge:
|
|
||||||
# Hostname to bind to. Blank for 0.0.0.0
|
|
||||||
hostname: ""
|
|
||||||
# Port. Probably shouldn't change this.
|
|
||||||
port: 45678
|
|
||||||
# Access key. CHANGE THIS OR GET SPAMMED.
|
|
||||||
key: password
|
|
||||||
# Stuff for redmine. Don't touch if you don't use redmine.
|
|
||||||
redmine:
|
|
||||||
# http://your.redmine.tld[/path]
|
|
||||||
url:
|
|
||||||
# Enable REST API and get an API Key. Then put it here.
|
|
||||||
apikey:
|
|
||||||
# Project to watch for new bugs.
|
|
||||||
# Note: For new bugs to be announced on the channel, you'll need to add a redmine-[projectID] tag.
|
|
||||||
project:
|
|
||||||
# Optional message format stuff. Uncomment to change the defaults.
|
|
||||||
#bug-info-format:'Redmine #{ID} - {AUTHOR} - {STATUS} - {SUBJECT}{CRLF}{URL}'
|
|
||||||
#new-bug-format: 'NEW ISSUE: {URL} (#{ID}: {SUBJECT})'
|
|
||||||
# Stuff for github. Don't touch if you don't use github.
|
|
||||||
github:
|
|
||||||
# http://github.com/USER_OR_ORG/REPO
|
|
||||||
#url: http://github.com/d3athrow/vgstation13
|
|
||||||
# Generate a login token and slap it here.
|
|
||||||
#apikey:
|
|
||||||
# Optional message format stuff. Uncomment to change the defaults.
|
|
||||||
#bug-info-format:'GitHub #{ID}: \'{SUBJECT}\' - {URL} ({STATUS})'
|
|
||||||
# Stuff for MediaWiki. Don't touch if you don't use MediaWiki.
|
|
||||||
mediawiki:
|
|
||||||
# http://your.wiki.tld/path/
|
|
||||||
#url: http://tgstation13.org/wiki/
|
|
||||||
@@ -1,155 +0,0 @@
|
|||||||
"""
|
|
||||||
Adapted from http://sprunge.us/iFQc?python
|
|
||||||
|
|
||||||
Thanks to mloc.
|
|
||||||
"""
|
|
||||||
from vgstation.common.plugin import IPlugin, Plugin
|
|
||||||
import vgstation.common.config as globalConfig
|
|
||||||
import logging, random, re, time
|
|
||||||
|
|
||||||
import github3
|
|
||||||
|
|
||||||
BUG_CHECK_DELAY = 60 # 60sec
|
|
||||||
|
|
||||||
REG_PATH = re.compile(r"\[([a-zA-Z\-_/][a-zA-Z0-9\- _/]*\.[a-zA-Z]+)\]", re.I)
|
|
||||||
REG_ISSUE = re.compile(r"\[#?([0-9]+)\]")
|
|
||||||
|
|
||||||
TREE_CHECK_DELAY = 300 # 5 minutes
|
|
||||||
|
|
||||||
REPLY_LIMIT=5
|
|
||||||
|
|
||||||
@Plugin
|
|
||||||
class GitHubPlugin(IPlugin):
|
|
||||||
def __init__(self, bot):
|
|
||||||
IPlugin.__init__(self, bot)
|
|
||||||
|
|
||||||
self.data=None
|
|
||||||
self.config=None
|
|
||||||
self.url=None
|
|
||||||
self.ignored=[]
|
|
||||||
self.auth=None
|
|
||||||
self.project_id=None
|
|
||||||
self.resource=None
|
|
||||||
self.lastCheck=0
|
|
||||||
|
|
||||||
self.tree = None
|
|
||||||
self.nextTreeDownload=0
|
|
||||||
|
|
||||||
self.config = globalConfig.get('plugins.github')
|
|
||||||
if self.config is None:
|
|
||||||
logging.warn('GitHub: Disabled.')
|
|
||||||
return
|
|
||||||
|
|
||||||
self.data = {
|
|
||||||
'last-bug-created': 0,
|
|
||||||
'ignored-names': [
|
|
||||||
'/^Not\-[0-9]+/' # Notifico bots
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
self.LoadPluginData()
|
|
||||||
|
|
||||||
self.url = globalConfig.get('plugins.github.url', None)
|
|
||||||
if self.url is None:
|
|
||||||
logging.error('GitHub: Disabled.')
|
|
||||||
return
|
|
||||||
# http://github.com/user/repo
|
|
||||||
repodata = self.url[18:]
|
|
||||||
if repodata.startswith('/'):
|
|
||||||
repodata = repodata[1:]
|
|
||||||
repoChunks = repodata.split('/')
|
|
||||||
self.user_id = repoChunks[0]
|
|
||||||
self.repo_id = repoChunks[1]
|
|
||||||
|
|
||||||
self.ignored = []
|
|
||||||
for ignoretok in self.data.get('ignored-names',['/^Not\-[0-9]/']):
|
|
||||||
if ignoretok.startswith('/') and ignoretok.endswith('/'):
|
|
||||||
self.ignored+=[re.compile(ignoretok[1:-1])]
|
|
||||||
else:
|
|
||||||
self.ignored+=[re.compile('^'+re.escape(ignoretok)+'$')]
|
|
||||||
|
|
||||||
self.bug_info_format = globalConfig.get('plugins.github.bug-info-format', 'GitHub #{ID}: \'{SUBJECT}\' - {URL} ({STATUS})')
|
|
||||||
|
|
||||||
#auth_user = globalConfig.get('plugins.github.username', None)
|
|
||||||
auth_key = globalConfig.get('plugins.github.apikey', None)
|
|
||||||
self.github = github3.login(token=auth_key)
|
|
||||||
self.repo = self.github.repository(self.user_id, self.repo_id)
|
|
||||||
self.default_branch = globalConfig.get('plugins.github.default_branch','master')
|
|
||||||
|
|
||||||
self.getTree()
|
|
||||||
|
|
||||||
def getTree(self):
|
|
||||||
if self.nextTreeDownload < time.time():
|
|
||||||
self.nextTreeDownload = time.time() + TREE_CHECK_DELAY
|
|
||||||
self.tree = self.repo.tree("HEAD").recurse().to_json()
|
|
||||||
|
|
||||||
def findPath(self, path):
|
|
||||||
pattern = re.compile("^.*(^|/){}$".format(path), re.I)
|
|
||||||
for entry in self.tree["tree"]:
|
|
||||||
if pattern.match(entry["path"]):
|
|
||||||
return(entry["path"])
|
|
||||||
|
|
||||||
def checkIgnore(self, nick):
|
|
||||||
for ignored in self.ignored:
|
|
||||||
m = ignored.search(nick)
|
|
||||||
if m is not None:
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def issueToString(self,issue):
|
|
||||||
bugmsg = self.bug_info_format
|
|
||||||
bugmsg = bugmsg.replace('{ID}', str(issue.number))
|
|
||||||
bugmsg = bugmsg.replace('{AUTHOR}', issue.user.login)
|
|
||||||
bugmsg = bugmsg.replace('{SUBJECT}', issue.title)
|
|
||||||
bugmsg = bugmsg.replace('{STATUS}', issue.state)
|
|
||||||
bugmsg = bugmsg.replace('{URL}', issue.html_url)
|
|
||||||
return bugmsg.split('{CRLF}')
|
|
||||||
|
|
||||||
def findBugs(self, event):
|
|
||||||
matches = REG_ISSUE.finditer(event.arguments[0])
|
|
||||||
ids = []
|
|
||||||
for match in matches:
|
|
||||||
ids += [match.group(1)]
|
|
||||||
|
|
||||||
replies = []
|
|
||||||
for id in ids:
|
|
||||||
issue = self.repo.issue(id)
|
|
||||||
if issue:
|
|
||||||
replies += self.issueToString(issue)
|
|
||||||
return replies
|
|
||||||
|
|
||||||
def findPaths(self, event):
|
|
||||||
matches = REG_PATH.finditer(event.arguments[0])
|
|
||||||
ids = []
|
|
||||||
for match in matches:
|
|
||||||
ids += [match.group(1)]
|
|
||||||
|
|
||||||
replies = []
|
|
||||||
for id in ids:
|
|
||||||
path = self.findPath(id)
|
|
||||||
if path:
|
|
||||||
replies += ['{}/blob/{}/{}'.format(self.url,self.default_branch,path)]
|
|
||||||
return replies
|
|
||||||
|
|
||||||
def OnChannelMessage(self, connection, event):
|
|
||||||
if self.data is None:
|
|
||||||
return
|
|
||||||
|
|
||||||
channel = event.target
|
|
||||||
|
|
||||||
if self.checkIgnore(event.source.nick):
|
|
||||||
return
|
|
||||||
|
|
||||||
replies=[]
|
|
||||||
replies += self.findBugs(event)
|
|
||||||
replies += self.findPaths(event)
|
|
||||||
|
|
||||||
if len(replies) > 0:
|
|
||||||
i=0
|
|
||||||
for reply in replies:
|
|
||||||
if reply is None or reply.strip() == '': continue
|
|
||||||
i+=1
|
|
||||||
if i > REPLY_LIMIT:
|
|
||||||
self.bot.privmsg(channel, 'More than {} results found, aborting to prevent spam.'.format(REPLY_LIMIT))
|
|
||||||
return
|
|
||||||
self.bot.privmsg(channel, reply)
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
"""
|
|
||||||
Adapted from http://sprunge.us/iFQc?python
|
|
||||||
|
|
||||||
Thanks to mloc.
|
|
||||||
"""
|
|
||||||
|
|
||||||
from vgstation.common.plugin import IPlugin, Plugin
|
|
||||||
import vgstation.common.config as globalConfig
|
|
||||||
import logging, random, re, time
|
|
||||||
|
|
||||||
REG_WIKI = re.compile(r"\[\[([a-zA-Z0-9_ ]+)\]\]")
|
|
||||||
|
|
||||||
REPLY_LIMIT = 5
|
|
||||||
|
|
||||||
@Plugin
|
|
||||||
class MediaWikiPlugin(IPlugin):
|
|
||||||
def __init__(self, bot):
|
|
||||||
IPlugin.__init__(self, bot)
|
|
||||||
|
|
||||||
self.data = None
|
|
||||||
self.config = None
|
|
||||||
self.url = 'http://tgstation13.org/wiki/'
|
|
||||||
|
|
||||||
self.config = globalConfig.get('plugins.mediawiki')
|
|
||||||
if self.config is None:
|
|
||||||
logging.warn('MediaWiki: Disabled.')
|
|
||||||
return
|
|
||||||
|
|
||||||
if 'url' in self.config:
|
|
||||||
self.url = self.config['url']
|
|
||||||
|
|
||||||
def findPage(self, event):
|
|
||||||
matches = REG_WIKI.finditer(event.arguments[0])
|
|
||||||
ids = []
|
|
||||||
for match in matches:
|
|
||||||
ids += [match.group(1)]
|
|
||||||
|
|
||||||
replies = []
|
|
||||||
for id in ids:
|
|
||||||
replies += [self.url + id]
|
|
||||||
return replies
|
|
||||||
|
|
||||||
def OnChannelMessage(self, connection, event):
|
|
||||||
if self.config is None:
|
|
||||||
return
|
|
||||||
|
|
||||||
channel = event.target
|
|
||||||
|
|
||||||
replies = []
|
|
||||||
replies += self.findPage(event)
|
|
||||||
|
|
||||||
if len(replies) > 0:
|
|
||||||
i = 0
|
|
||||||
for reply in replies:
|
|
||||||
if reply is None or reply.strip() == '': continue
|
|
||||||
i += 1
|
|
||||||
if i > REPLY_LIMIT:
|
|
||||||
self.bot.privmsg(channel, 'More than {} results found, aborting to prevent spam.'.format(REPLY_LIMIT))
|
|
||||||
return
|
|
||||||
self.bot.privmsg(channel, reply)
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
'''
|
|
||||||
Created on Dec 12, 2013
|
|
||||||
|
|
||||||
@author: Rob
|
|
||||||
'''
|
|
||||||
|
|
||||||
from vgstation.common.plugin import IPlugin, Plugin
|
|
||||||
import vgstation.common.config as globalConfig
|
|
||||||
import thread, socket, logging
|
|
||||||
|
|
||||||
@Plugin
|
|
||||||
class NudgePlugin(IPlugin):
|
|
||||||
|
|
||||||
def __init__(self, bot):
|
|
||||||
IPlugin.__init__(self, bot)
|
|
||||||
|
|
||||||
self.RegisterCommand('shaddap', self.OnShaddap, help='Bot will stop processing nudges.')
|
|
||||||
self.RegisterCommand('speak', self.OnSpeak, help='Bot will start processing nudges.')
|
|
||||||
|
|
||||||
self.dropNudges = False
|
|
||||||
|
|
||||||
self.config = globalConfig.get('plugins.nudge')
|
|
||||||
if self.config is None:
|
|
||||||
logging.warning('plugin.nudge not present in config. Aborting load.')
|
|
||||||
return
|
|
||||||
|
|
||||||
thread.start_new_thread(self.nudge_listener, ())
|
|
||||||
|
|
||||||
def OnShaddap(self, event, args):
|
|
||||||
self.dropNudges = True
|
|
||||||
self.bot.notice(event.source.nick, 'Now dropping nudges.')
|
|
||||||
return True
|
|
||||||
|
|
||||||
def OnSpeak(self, event, args):
|
|
||||||
self.dropNudges = False
|
|
||||||
self.bot.notice(event.source.nick, 'No longer dropping nudges.')
|
|
||||||
return True
|
|
||||||
|
|
||||||
def nudge_listener(self):
|
|
||||||
import pickle
|
|
||||||
nudgeconfig = globalConfig.get('plugins.nudge')
|
|
||||||
port = nudgeconfig['port']
|
|
||||||
host = nudgeconfig['hostname']
|
|
||||||
backlog = 5
|
|
||||||
size = 1024
|
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
||||||
s.bind((host, port))
|
|
||||||
s.listen(backlog)
|
|
||||||
while True:
|
|
||||||
# Second arg is address.
|
|
||||||
client, _ = s.accept() # Address == "?.?.?.?"
|
|
||||||
data = client.recv(size)
|
|
||||||
client.close() # Throw the bum out!
|
|
||||||
truedata = pickle.loads(data)
|
|
||||||
to = None
|
|
||||||
msg = None
|
|
||||||
if truedata.get('key', '') != nudgeconfig['key']:
|
|
||||||
logging.info('Dropped nudge (BAD KEY): {0}'.format(repr(truedata)))
|
|
||||||
continue
|
|
||||||
if truedata.get("channel", None) is not None:
|
|
||||||
to = truedata["channel"]
|
|
||||||
msg = 'AUTOMATIC ANNOUNCEMENT: [{0}] {1}'.format(truedata['id'], truedata["data"])
|
|
||||||
|
|
||||||
if self.dropNudges:
|
|
||||||
if to == None:
|
|
||||||
to = 'All'
|
|
||||||
logging.info('Dropped nudge to {0}: {1}'.format(to, msg))
|
|
||||||
continue
|
|
||||||
else:
|
|
||||||
if to is None:
|
|
||||||
self.bot.sendToAllFlagged('nudges', msg)
|
|
||||||
else:
|
|
||||||
self.bot.sendToAllFlagged(to, msg)
|
|
||||||
@@ -1,157 +0,0 @@
|
|||||||
"""
|
|
||||||
Adapted from the Supybot plugin.
|
|
||||||
"""
|
|
||||||
from vgstation.common.plugin import IPlugin, Plugin
|
|
||||||
import vgstation.common.config as globalConfig
|
|
||||||
import logging, random, re, time
|
|
||||||
# import restkit
|
|
||||||
from restkit import BasicAuth, Resource, RequestError
|
|
||||||
from restkit.errors import RequestFailed, ResourceNotFound
|
|
||||||
import simplejson as json
|
|
||||||
|
|
||||||
BUG_CHECK_DELAY = 60 # 60sec
|
|
||||||
|
|
||||||
@Plugin
|
|
||||||
class RedminePlugin(IPlugin):
|
|
||||||
def __init__(self, bot):
|
|
||||||
IPlugin.__init__(self, bot)
|
|
||||||
|
|
||||||
self.data=None
|
|
||||||
self.config=None
|
|
||||||
self.url=None
|
|
||||||
self.ignored=[]
|
|
||||||
self.auth=None
|
|
||||||
self.project_id=None
|
|
||||||
self.resource=None
|
|
||||||
self.lastCheck=0
|
|
||||||
|
|
||||||
self.config = globalConfig.get('plugins.redmine')
|
|
||||||
if self.config is None:
|
|
||||||
logging.error('Redmine: Disabled.')
|
|
||||||
return
|
|
||||||
|
|
||||||
self.data = {
|
|
||||||
'last-bug-created': 0,
|
|
||||||
'ignored-names': [
|
|
||||||
'/^Not\-[0-9]+/' # Notifico bots
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
self.LoadPluginData()
|
|
||||||
|
|
||||||
self.url = globalConfig.get('plugins.redmine.url', None)
|
|
||||||
if self.url is None:
|
|
||||||
logging.error('Redmine: Disabled.')
|
|
||||||
|
|
||||||
return
|
|
||||||
self.ignored = []
|
|
||||||
for ignoretok in self.data.get('ignored-names',['/^Not\-[0-9]/']):
|
|
||||||
if ignoretok.startwith('/') and ignoretok.endwith('/'):
|
|
||||||
self.ignored+=[re.compile(ignoretok[1:-1])]
|
|
||||||
else:
|
|
||||||
self.ignored+=[re.compile('^'+re.escape(ignoretok)+'$')]
|
|
||||||
self.auth = BasicAuth(globalConfig.get('plugins.redmine.apikey', None), str(random.random()))
|
|
||||||
self.project_id = globalConfig.get('plugins.redmine.project', None)
|
|
||||||
if self.project_id is None: logging.warning('Redmine: Not going to check for bug updates.')
|
|
||||||
self.bug_info_format = globalConfig.get('plugins.redmine.bug-info-format', 'Redmine #{ID} - {AUTHOR} - {STATUS} - {SUBJECT}{CRLF}{URL}')
|
|
||||||
self.new_bug_format = globalConfig.get('plugins.redmine.new-bug-format', 'NEW ISSUE: {URL} (#{ID}: {SUBJECT})')
|
|
||||||
self.resource = Resource(self.url, filters=[self.auth])
|
|
||||||
|
|
||||||
self.bug_regex = re.compile(r'#(\d+)\b')
|
|
||||||
|
|
||||||
self.lastCheck = 0
|
|
||||||
|
|
||||||
def checkIgnore(self, nick):
|
|
||||||
for ignored in self.ignored:
|
|
||||||
m = ignored.search(nick)
|
|
||||||
if m is not None:
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def OnChannelMessage(self, connection, event):
|
|
||||||
if self.data is None:
|
|
||||||
return
|
|
||||||
channel = event.target
|
|
||||||
if self.checkIgnore(event.source.nick): return
|
|
||||||
matches = self.bug_regex.finditer(event.arguments[0])
|
|
||||||
ids = []
|
|
||||||
for match in matches:
|
|
||||||
ids += [match.group(1)]
|
|
||||||
|
|
||||||
strings = self.getBugs(ids, self.bug_info_format)
|
|
||||||
for s in strings:
|
|
||||||
self.bot.privmsg(channel, s)
|
|
||||||
|
|
||||||
def OnPing(self):
|
|
||||||
if self.data is None:
|
|
||||||
return
|
|
||||||
if not self.bot.welcomeReceived:
|
|
||||||
logging.info('Received PING, but no welcome yet.')
|
|
||||||
return
|
|
||||||
now = time.time()
|
|
||||||
if self.lastCheck + BUG_CHECK_DELAY < now:
|
|
||||||
self.lastCheck = now
|
|
||||||
bugs = self.getAllBugs(project_id=self.project_id, sort='created_on:desc')
|
|
||||||
if bugs is None: return
|
|
||||||
# print(repr(bugs))
|
|
||||||
lbc = ''
|
|
||||||
for bug in bugs['issues']:
|
|
||||||
if bug['created_on'] != self.data['last-bug-created']:
|
|
||||||
if lbc == '':
|
|
||||||
lbc = bug['created_on']
|
|
||||||
strings = self.getBugs([bug['id']], self.new_bug_format)
|
|
||||||
for s in strings:
|
|
||||||
self.bot.sendToAllFlagged('redmine-' + self.project_id, s)
|
|
||||||
else:
|
|
||||||
break
|
|
||||||
if lbc == '':
|
|
||||||
return
|
|
||||||
self.data['last-bug-created'] = lbc
|
|
||||||
self.SavePluginData()
|
|
||||||
|
|
||||||
def getBugs(self, ids, fmt):
|
|
||||||
if self.data is None:
|
|
||||||
return
|
|
||||||
strings = []
|
|
||||||
for id in ids:
|
|
||||||
# Getting response
|
|
||||||
try:
|
|
||||||
response = self.resource.get('/issues/' + str(id) + '.json')
|
|
||||||
data = response.body_string()
|
|
||||||
result = json.loads(data)
|
|
||||||
# Formatting reply
|
|
||||||
# self.log.info("info " + bugmsg);
|
|
||||||
bugmsg = fmt
|
|
||||||
bugmsg = bugmsg.replace('{ID}', str(id))
|
|
||||||
bugmsg = bugmsg.replace('{AUTHOR}', result['issue']['author']['name'])
|
|
||||||
bugmsg = bugmsg.replace('{SUBJECT}', result['issue']['subject'])
|
|
||||||
bugmsg = bugmsg.replace('{STATUS}', result['issue']['status']['name'])
|
|
||||||
bugmsg = bugmsg.replace('{PROJECT}', result['issue']['project']['name'])
|
|
||||||
try:
|
|
||||||
bugmsg = bugmsg.replace('{CATEGORY}', result['issue']['category']['name'])
|
|
||||||
except Exception:
|
|
||||||
bugmsg = bugmsg.replace('{CATEGORY}', 'uncategorized')
|
|
||||||
bugmsg = bugmsg.replace('{URL}', "%s/issues/%s" % (self.url, id))
|
|
||||||
bugmsg = bugmsg.split('{CRLF}')
|
|
||||||
|
|
||||||
for msg in bugmsg:
|
|
||||||
strings.append(msg)
|
|
||||||
|
|
||||||
except ResourceNotFound:
|
|
||||||
# strings.append("Unable to find redmine issue {0}.".format(id))
|
|
||||||
continue
|
|
||||||
|
|
||||||
return strings
|
|
||||||
|
|
||||||
def getAllBugs(self, **kwargs):
|
|
||||||
if self.data is None:
|
|
||||||
return
|
|
||||||
# Getting response
|
|
||||||
try:
|
|
||||||
response = self.resource.get('/issues.json', **kwargs)
|
|
||||||
data = response.body_string()
|
|
||||||
return json.loads(data)
|
|
||||||
|
|
||||||
except RequestFailed as e:
|
|
||||||
logging.error('HTTP Error {0}: {1}'.format(e.status_int, e.message))
|
|
||||||
return None
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
# Inspired by Skilibliaasdadas's bot.
|
|
||||||
|
|
||||||
# nt, tell nickname something
|
|
||||||
# nt, received
|
|
||||||
|
|
||||||
from vgstation.common.plugin import IPlugin, Plugin
|
|
||||||
import vgstation.common.config as globalConfig
|
|
||||||
|
|
||||||
@Plugin
|
|
||||||
class TellPlugin(IPlugin):
|
|
||||||
def __init__(self, bot):
|
|
||||||
IPlugin.__init__(self, bot)
|
|
||||||
|
|
||||||
# Recipient => Messages ({from,message})
|
|
||||||
self.data = {}
|
|
||||||
self.LoadPluginData()
|
|
||||||
|
|
||||||
# {from,to,message}
|
|
||||||
self.lastMessages = []
|
|
||||||
|
|
||||||
self.RegisterCommand('tell', self.OnTell, help='Leave a message for someone.')
|
|
||||||
self.RegisterCommand('received', self.OnReceived, help='Bot will mark messages sent to you as read.')
|
|
||||||
self.RegisterCommand('messages', self.OnMessages, help='Rattle off the messages sent to you.')
|
|
||||||
self.RegisterCommand('belay', self.OnBelay, help='Remove last message you sent.')
|
|
||||||
|
|
||||||
def OnTell(self, event, args):
|
|
||||||
channel = event.target
|
|
||||||
nick = event.source.nick
|
|
||||||
if len(args) < 3:
|
|
||||||
self.bot.notice(nick,'The format is: bot, tell NICKNAME MESSAGE TO SEND')
|
|
||||||
msg = ' '.join(args[2:])
|
|
||||||
to = args[1]
|
|
||||||
message = {'from':nick, 'to':to, 'message':msg}
|
|
||||||
self.lastMessages += [message]
|
|
||||||
if to not in self.data:
|
|
||||||
self.data[to] = []
|
|
||||||
else:
|
|
||||||
if len(self.data[to]) == 5:
|
|
||||||
self.bot.privmsg(channel, '{to} has too many messages. They need to use the received command before I can add more.'.format(**message))
|
|
||||||
return True
|
|
||||||
self.data[to] += [message]
|
|
||||||
self.SavePluginData()
|
|
||||||
self.bot.privmsg(channel, 'Your message has been sent. It will be displayed the next time {to} joins or uses messages.'.format(**message))
|
|
||||||
return True
|
|
||||||
|
|
||||||
def OnReceived(self, event, args):
|
|
||||||
channel = event.target
|
|
||||||
nick = event.source.nick
|
|
||||||
self.data[nick] = []
|
|
||||||
self.SavePluginData()
|
|
||||||
self.bot.privmsg(channel, 'Your messages have been cleared.')
|
|
||||||
return True
|
|
||||||
|
|
||||||
def OnBelay(self, event, args):
|
|
||||||
channel = event.target
|
|
||||||
nick = event.source.nick
|
|
||||||
lm = None
|
|
||||||
for m in self.lastMessages:
|
|
||||||
if m['from'] == nick:
|
|
||||||
lm = m
|
|
||||||
if lm is not None:
|
|
||||||
self.data[lm['to']].remove(lm)
|
|
||||||
self.bot.privmsg(channel, 'Your message to {to} was removed.'.format(**lm))
|
|
||||||
self.SavePluginData()
|
|
||||||
return True
|
|
||||||
|
|
||||||
def OnJoin(self, channel, nick):
|
|
||||||
self.SendMessages(channel, nick)
|
|
||||||
return False # Let other plugins use it.
|
|
||||||
|
|
||||||
def OnMessages(self, event, args):
|
|
||||||
channel = event.target
|
|
||||||
nick = event.source.nick
|
|
||||||
|
|
||||||
self.SendMessages(channel,nick)
|
|
||||||
return True
|
|
||||||
|
|
||||||
def SendMessages(self,channel,nick):
|
|
||||||
if nick in self.data:
|
|
||||||
if len(self.data[nick]) > 0:
|
|
||||||
self.bot.privmsg(channel, '{0}, you have {1} messages. Say "{2}, received" to clear them.'.format(nick, len(self.data[nick]), globalConfig.get('names', ['nt'])[0]))
|
|
||||||
for message in self.data[nick]:
|
|
||||||
self.bot.privmsg(channel, '{from}: {message}'.format(**message))
|
|
||||||
|
|
||||||
26
bot/vgbot.py
26
bot/vgbot.py
@@ -1,26 +0,0 @@
|
|||||||
'''
|
|
||||||
Created on Dec 12, 2013
|
|
||||||
|
|
||||||
@author: Rob
|
|
||||||
'''
|
|
||||||
import vgstation.common.config as config
|
|
||||||
import vgstation.common.plugin as plugins
|
|
||||||
import vgstation.bot as irc
|
|
||||||
import logging, time
|
|
||||||
|
|
||||||
def main():
|
|
||||||
logging.basicConfig(format='%(asctime)s [%(levelname)-8s]: %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p', level=logging.INFO)
|
|
||||||
config.ReadFromDisk()
|
|
||||||
for server in config.config['servers']:
|
|
||||||
while True:
|
|
||||||
try:
|
|
||||||
bot = irc.Bot(server,config.config['servers'][server])
|
|
||||||
bot.plugins = plugins.Load(bot)
|
|
||||||
bot.start()
|
|
||||||
except Exception as e:
|
|
||||||
logging.critical(str(e))
|
|
||||||
logging.info('Waiting 10 seconds before reconnecting...')
|
|
||||||
time.sleep(10)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
@@ -1,123 +0,0 @@
|
|||||||
import string
|
|
||||||
import irc.bot
|
|
||||||
import vgstation.common.config as globalConfig
|
|
||||||
import logging
|
|
||||||
|
|
||||||
class Bot(irc.bot.SingleServerIRCBot):
|
|
||||||
def __init__(self, hostname, config):
|
|
||||||
logging.info('Starting up.' + repr(config))
|
|
||||||
port = config['port']
|
|
||||||
nickname = config['nick']
|
|
||||||
|
|
||||||
irc.bot.SingleServerIRCBot.__init__(self, [(hostname, port)], nickname, nickname)
|
|
||||||
|
|
||||||
self.chanconfig = config['channels']
|
|
||||||
|
|
||||||
self.command = {}
|
|
||||||
self.plugins = []
|
|
||||||
for i in ["ping"]:
|
|
||||||
self.connection.add_global_handler(i, getattr(self, "on_" + i), 0)
|
|
||||||
self.welcomeReceived = False
|
|
||||||
|
|
||||||
self.messageQueue = []
|
|
||||||
self.connection.execute_every(1, self.SendQueuedMessage)
|
|
||||||
|
|
||||||
def SendQueuedMessage(self):
|
|
||||||
if len(self.messageQueue) == 0: return
|
|
||||||
msg = self.messageQueue[0]
|
|
||||||
msgtype, target, message = msg
|
|
||||||
logging.info('{0} -> {1}: {2}'.format(msgtype, target, self.stripUnprintable(message)))
|
|
||||||
if msgtype == 'PRIVMSG':
|
|
||||||
self.connection.privmsg(target, message)
|
|
||||||
elif msgtype == 'NOTICE':
|
|
||||||
self.connection.notice(target, message)
|
|
||||||
self.messageQueue.remove(msg)
|
|
||||||
|
|
||||||
def on_join(self, c, e):
|
|
||||||
ch = e.target
|
|
||||||
nick = e.source.nick
|
|
||||||
for plugin in self.plugins:
|
|
||||||
if plugin.OnJoin(ch, nick): break
|
|
||||||
|
|
||||||
def on_ping(self, c, e):
|
|
||||||
for plugin in self.plugins:
|
|
||||||
if plugin.OnPing(): break
|
|
||||||
|
|
||||||
def on_nicknameinuse(self, c, e):
|
|
||||||
c.nick(c.get_nickname() + "_")
|
|
||||||
|
|
||||||
def on_welcome(self, c, e):
|
|
||||||
self.welcomeReceived = True
|
|
||||||
for channel, channelconfig in self.chanconfig.items():
|
|
||||||
password = channelconfig.get('password', None)
|
|
||||||
logging.info('Joining {0}...'.format(channel))
|
|
||||||
if password is None:
|
|
||||||
c.join(channel)
|
|
||||||
else:
|
|
||||||
c.join(channel, password)
|
|
||||||
|
|
||||||
def on_privmsg(self, c, e):
|
|
||||||
msg = e.arguments[0]
|
|
||||||
msg = self.stripUnprintable(msg)
|
|
||||||
logging.info('PRIVMSG: <{0}> {1}'.format(e.source.nick, msg))
|
|
||||||
self.do_command(e, e.arguments[0])
|
|
||||||
|
|
||||||
def on_pubmsg(self, c, e):
|
|
||||||
# logging.info(msg.source)
|
|
||||||
msg = e.arguments[0]
|
|
||||||
msg = self.stripUnprintable(msg)
|
|
||||||
logging.info('PUBMSG: <{0}:{1}> {2}'.format(e.source.nick, e.target, msg))
|
|
||||||
if ',' in msg:
|
|
||||||
args = msg.split(',', 1)
|
|
||||||
logging.debug(repr(args))
|
|
||||||
if len(args) > 1 and args[0] in globalConfig.get('names', []):
|
|
||||||
self.do_command(e, args[1].strip())
|
|
||||||
else:
|
|
||||||
for plugin in self.plugins:
|
|
||||||
if plugin.OnChannelMessage(c, e): break
|
|
||||||
return
|
|
||||||
|
|
||||||
def on_dccmsg(self, c, e):
|
|
||||||
c.privmsg('Please speak to me in chat or in a PRIVMSG.')
|
|
||||||
|
|
||||||
def on_dccchat(self, c, e):
|
|
||||||
return
|
|
||||||
|
|
||||||
def stripUnprintable(self, msg):
|
|
||||||
return filter(lambda x: x in string.printable, msg)
|
|
||||||
|
|
||||||
def notice(self, nick, message):
|
|
||||||
self.messageQueue += [('NOTICE', nick, message)]
|
|
||||||
# self.connection.notice(nick, message)
|
|
||||||
|
|
||||||
def privmsg(self, nick, message):
|
|
||||||
self.messageQueue += [('PRIVMSG', nick, message)]
|
|
||||||
# self.connection.privmsg(nick, message)
|
|
||||||
|
|
||||||
def do_command(self, e, cmd):
|
|
||||||
nick = e.source.nick
|
|
||||||
channel = nick
|
|
||||||
if e.target:
|
|
||||||
channel = e.target
|
|
||||||
args = cmd.split(' ')
|
|
||||||
cmd = args[0]
|
|
||||||
c = self.connection
|
|
||||||
if cmd == 'help':
|
|
||||||
self.privmsg(nick, '-- VGBot 1.0 Help: (All commands are accessed with {0}, <command> [args]'.format(c.get_nickname()))
|
|
||||||
for name in sorted(self.command.keys()):
|
|
||||||
self.privmsg(nick, ' {0}: {1}'.format(name, self.command[name].get('help', 'No help= argument for this command.')))
|
|
||||||
elif cmd == 'version':
|
|
||||||
self.notice(channel, 'VGBot 1.0 - By N3X15') # pls to not change
|
|
||||||
elif cmd in self.command:
|
|
||||||
self.command[cmd]['handler'](e, args)
|
|
||||||
else:
|
|
||||||
self.notice(channel, 'I don\'t know that command, sorry. Say "{0}, help" for available commands.'.format(c.get_nickname()))
|
|
||||||
|
|
||||||
def sendToAllFlagged(self, flag, msg):
|
|
||||||
for channel, chandata in self.chanconfig.items():
|
|
||||||
if chandata.get(flag, False) == True:
|
|
||||||
self.privmsg(channel, msg)
|
|
||||||
|
|
||||||
def haveJoined(self, channel):
|
|
||||||
return channel in self.channels
|
|
||||||
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
'''
|
|
||||||
Created on Jul 28, 2013
|
|
||||||
|
|
||||||
@author: Rob
|
|
||||||
'''
|
|
||||||
import os, yaml
|
|
||||||
config = {
|
|
||||||
'names': [
|
|
||||||
'NT',
|
|
||||||
'VGTestServer'
|
|
||||||
],
|
|
||||||
'servers':{
|
|
||||||
'irc.server.tld': {
|
|
||||||
'port':6667,
|
|
||||||
'password':None,
|
|
||||||
'channels':{
|
|
||||||
'#vgstation': {
|
|
||||||
'nudges':True,
|
|
||||||
'status':True
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
'plugins':
|
|
||||||
{
|
|
||||||
'redmine': {
|
|
||||||
'url': '',
|
|
||||||
'apikey':''
|
|
||||||
},
|
|
||||||
'nudge': {
|
|
||||||
'hostname': '',
|
|
||||||
'port': 45678,
|
|
||||||
'key': 'passwordgoeshere'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def ReadFromDisk():
|
|
||||||
global config
|
|
||||||
config_file = 'config.yml'
|
|
||||||
if not os.path.isfile(config_file):
|
|
||||||
with open(config_file, 'w') as cw:
|
|
||||||
yaml.dump(config, cw, default_flow_style=False)
|
|
||||||
|
|
||||||
with open(config_file, 'r') as cr:
|
|
||||||
config = yaml.load(cr)
|
|
||||||
|
|
||||||
# if config['database']['username'] == '' or config['database']['password'] == '' or config['database']['schema'] == '':
|
|
||||||
# print('!!! Default config.yml detected. Please edit it before continuing.')
|
|
||||||
# sys.exit(1)
|
|
||||||
|
|
||||||
def get(key,default=None):
|
|
||||||
global config
|
|
||||||
try:
|
|
||||||
parts = key.split('.')
|
|
||||||
value = config[parts[0]]
|
|
||||||
if len(parts) == 1:
|
|
||||||
return value
|
|
||||||
for part in parts[1:]:
|
|
||||||
value = value[part]
|
|
||||||
return value
|
|
||||||
except KeyError:
|
|
||||||
return default
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
'''
|
|
||||||
Created on Aug 26, 2012
|
|
||||||
|
|
||||||
@author: Rob
|
|
||||||
'''
|
|
||||||
# print 'Loading '+__file__
|
|
||||||
import logging, os, glob, yaml
|
|
||||||
|
|
||||||
def DefinePlugin():
|
|
||||||
registry = {}
|
|
||||||
def handler(_class):
|
|
||||||
packageID = _class.__module__ + "." + _class.__name__
|
|
||||||
registry[packageID] = {
|
|
||||||
'name':_class.Name,
|
|
||||||
'class':_class
|
|
||||||
}
|
|
||||||
return _class
|
|
||||||
handler.all = registry
|
|
||||||
return handler
|
|
||||||
|
|
||||||
Plugin = DefinePlugin()
|
|
||||||
|
|
||||||
def Load(bot):
|
|
||||||
for f in glob.glob(os.path.join(os.path.curdir, 'plugins', "*.py")):
|
|
||||||
modName = 'plugins.' + os.path.basename(f)[:-3]
|
|
||||||
logging.info('Loading ' + modName)
|
|
||||||
mod = __import__(modName)
|
|
||||||
for attr in dir(mod):
|
|
||||||
if not attr.startswith('_'):
|
|
||||||
globals()[attr] = getattr(mod, attr)
|
|
||||||
o = []
|
|
||||||
logging.info('Loaded: ' + repr(Plugin.all))
|
|
||||||
for key in Plugin.all:
|
|
||||||
currentHandler = Plugin.all[key]['class']
|
|
||||||
o += [currentHandler(bot)]
|
|
||||||
return o
|
|
||||||
|
|
||||||
class IPlugin(object):
|
|
||||||
Name = 'Plugin'
|
|
||||||
def __init__(self, bot):
|
|
||||||
'''
|
|
||||||
@param bot: The bot.
|
|
||||||
'''
|
|
||||||
self.bot = bot
|
|
||||||
|
|
||||||
def LoadPluginData(self):
|
|
||||||
self.datadir = os.path.join('data')
|
|
||||||
if not os.path.isdir(self.datadir):
|
|
||||||
os.makedirs(self.datadir)
|
|
||||||
self.datafile = os.path.join(self.datadir, self.__class__.__name__+'.yml')
|
|
||||||
if os.path.isfile(self.datafile):
|
|
||||||
with open(self.datafile, 'r') as stream:
|
|
||||||
self.data = yaml.load(stream)
|
|
||||||
|
|
||||||
def SavePluginData(self):
|
|
||||||
with open(self.datafile, 'w') as stream:
|
|
||||||
yaml.dump(self.data, stream)
|
|
||||||
|
|
||||||
def RegisterCommand(self, command, handler, **kwargs):
|
|
||||||
if command in self.bot.command:
|
|
||||||
logging.warning('Command {0} cannot be registered twice!'.format(command))
|
|
||||||
return
|
|
||||||
kwargs['handler'] = handler
|
|
||||||
self.bot.command[command] = kwargs
|
|
||||||
|
|
||||||
def OnChannelMessage(self, connection, event):
|
|
||||||
return False # Not handled
|
|
||||||
|
|
||||||
def OnPing(self):
|
|
||||||
return False # Not handled
|
|
||||||
|
|
||||||
def OnJoin(self,channel,nick):
|
|
||||||
return False # Not handled
|
|
||||||
BIN
libmysql.dll
BIN
libmysql.dll
Binary file not shown.
@@ -1,2 +0,0 @@
|
|||||||
[build]
|
|
||||||
rustflags = ["-C", "target-feature=+crt-static"]
|
|
||||||
4
libvg/.gitignore
vendored
4
libvg/.gitignore
vendored
@@ -1,4 +0,0 @@
|
|||||||
target
|
|
||||||
Cargo.lock
|
|
||||||
# rustftm backups.
|
|
||||||
*.rs.bk
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "libvg"
|
|
||||||
version = "0.1.0"
|
|
||||||
authors = ["PJB3005 <pieterjan.briers@gmail.com>"]
|
|
||||||
publish = false
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
byond = "0.3.0"
|
|
||||||
encoding = "0.2.33"
|
|
||||||
libc = "0.2.19"
|
|
||||||
|
|
||||||
[lib]
|
|
||||||
name = "libvg"
|
|
||||||
crate-type = ["dylib"]
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
all:
|
|
||||||
cargo build --release --target i686-unknown-linux-gnu
|
|
||||||
if [ -f ../libvg.so ]; then rm ../libvg.so; fi
|
|
||||||
cp target/i686-unknown-linux-gnu/release/liblibvg.so ../libvg.so
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
# What's this?
|
|
||||||
This is a [Rust](https://www.rust-lang.org)-based library that is invoked throughout the /vg/station13 code.
|
|
||||||
|
|
||||||
# Uses:
|
|
||||||
* UTF-8 handling.
|
|
||||||
|
|
||||||
# Building
|
|
||||||
First of all, you're gonna need to install **nightly** Rust. The website (linked above) has the Rustup installer which you can use to easily install the Rust toolchain. If you are on a 64-bit system it'll probably install `x86_64` for you, though because BYOND is stuck in the stone age you need to compile for `i686` instead. To install the `i686` version of the toolchain, simply run:
|
|
||||||
```powershell
|
|
||||||
rustup default nightly-i686
|
|
||||||
```
|
|
||||||
|
|
||||||
Easiest way to build on both Windows and Linux is to run `build.ps1` with Powershell.
|
|
||||||
If you do not have Powershell installed on Linux, a basic makefile is also available.
|
|
||||||
|
|
||||||
If either of those don't work, do not fear! Building Rust code is extremely simple. To build manually, simply run the following command:
|
|
||||||
|
|
||||||
```powershell
|
|
||||||
cargo build --release --target $target
|
|
||||||
```
|
|
||||||
|
|
||||||
Where `$target` is `i686-pc-windows-msvc` on Windows or `i686-unknown-linux-gnu` on Linux.
|
|
||||||
|
|
||||||
The binary will then be placed in `target/$target/release/`, which you can copy next to the root project. On Linux it's incorrectly named as `liblibvg.so`, so make sure to rename it to `libvg.so` when you do!
|
|
||||||
|
|
||||||
# Troubleshooting
|
|
||||||
|
|
||||||
#### I get this error when compiling: `/usr/bin/ld: cannot find crti.o: No such file or directory`
|
|
||||||
You likely only have the 64bit version of gcc installed. Install `gcc-multilib` so you can build for other architectures.
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
#!/usr/bin/env powershell
|
|
||||||
# Assume that if IsWindows doesn't exist, we're on Windows.
|
|
||||||
# This assumption is because outdated Powershell versions don't have the variable.
|
|
||||||
if ($IsWindows -Or !(Test-Path variable:global:IsWindows))
|
|
||||||
{
|
|
||||||
$target = "i686-pc-windows-msvc"
|
|
||||||
$filename = "libvg"
|
|
||||||
$ext = "dll"
|
|
||||||
}
|
|
||||||
elseif ($IsLinux)
|
|
||||||
{
|
|
||||||
$target = "i686-unknown-linux-gnu"
|
|
||||||
$filename = "liblibvg"
|
|
||||||
$ext = "so"
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Write-Error "BYOND only runs on Linux or Windows, what're you even building libvg for?"
|
|
||||||
}
|
|
||||||
|
|
||||||
cargo build --release --target $target
|
|
||||||
|
|
||||||
if ($?)
|
|
||||||
{
|
|
||||||
if (Test-Path "../libvg.$ext")
|
|
||||||
{
|
|
||||||
Write-Host "Deleting old version of libvg in the project root."
|
|
||||||
Remove-Item "../libvg.$ext"
|
|
||||||
}
|
|
||||||
Copy-Item "target/$target/release/$filename.$ext" "../libvg.$ext"
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Write-Error "There was an error during the build."
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
// Disallow warnings when testing.
|
|
||||||
// #![cfg_attr(test, deny(warnings))]
|
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate byond;
|
|
||||||
extern crate encoding;
|
|
||||||
extern crate libc;
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
|
||||||
# Visual Studio 2010
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnstandardnessTestForDM", "UnstandardnessTestForDM\UnstandardnessTestForDM.csproj", "{A0EEBFC9-41D4-474D-853D-126AFDFB82DE}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|x86 = Debug|x86
|
|
||||||
Release|x86 = Release|x86
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{A0EEBFC9-41D4-474D-853D-126AFDFB82DE}.Debug|x86.ActiveCfg = Debug|x86
|
|
||||||
{A0EEBFC9-41D4-474D-853D-126AFDFB82DE}.Debug|x86.Build.0 = Debug|x86
|
|
||||||
{A0EEBFC9-41D4-474D-853D-126AFDFB82DE}.Release|x86.ActiveCfg = Release|x86
|
|
||||||
{A0EEBFC9-41D4-474D-853D-126AFDFB82DE}.Release|x86.Build.0 = Release|x86
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
||||||
Binary file not shown.
@@ -1,160 +0,0 @@
|
|||||||
namespace UnstandardnessTestForDM
|
|
||||||
{
|
|
||||||
partial class Form1
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Required designer variable.
|
|
||||||
/// </summary>
|
|
||||||
private System.ComponentModel.IContainer components = null;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Clean up any resources being used.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
|
||||||
protected override void Dispose(bool disposing)
|
|
||||||
{
|
|
||||||
if (disposing && (components != null))
|
|
||||||
{
|
|
||||||
components.Dispose();
|
|
||||||
}
|
|
||||||
base.Dispose(disposing);
|
|
||||||
}
|
|
||||||
|
|
||||||
#region Windows Form Designer generated code
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Required method for Designer support - do not modify
|
|
||||||
/// the contents of this method with the code editor.
|
|
||||||
/// </summary>
|
|
||||||
private void InitializeComponent()
|
|
||||||
{
|
|
||||||
this.button1 = new System.Windows.Forms.Button();
|
|
||||||
this.listBox1 = new System.Windows.Forms.ListBox();
|
|
||||||
this.panel1 = new System.Windows.Forms.Panel();
|
|
||||||
this.listBox2 = new System.Windows.Forms.ListBox();
|
|
||||||
this.label4 = new System.Windows.Forms.Label();
|
|
||||||
this.label3 = new System.Windows.Forms.Label();
|
|
||||||
this.label2 = new System.Windows.Forms.Label();
|
|
||||||
this.label1 = new System.Windows.Forms.Label();
|
|
||||||
this.label5 = new System.Windows.Forms.Label();
|
|
||||||
this.panel1.SuspendLayout();
|
|
||||||
this.SuspendLayout();
|
|
||||||
//
|
|
||||||
// button1
|
|
||||||
//
|
|
||||||
this.button1.Location = new System.Drawing.Point(12, 12);
|
|
||||||
this.button1.Name = "button1";
|
|
||||||
this.button1.Size = new System.Drawing.Size(222, 23);
|
|
||||||
this.button1.TabIndex = 0;
|
|
||||||
this.button1.Text = "Locate all #defines";
|
|
||||||
this.button1.UseVisualStyleBackColor = true;
|
|
||||||
this.button1.Click += new System.EventHandler(this.button1_Click);
|
|
||||||
//
|
|
||||||
// listBox1
|
|
||||||
//
|
|
||||||
this.listBox1.FormattingEnabled = true;
|
|
||||||
this.listBox1.Location = new System.Drawing.Point(12, 82);
|
|
||||||
this.listBox1.Name = "listBox1";
|
|
||||||
this.listBox1.Size = new System.Drawing.Size(696, 160);
|
|
||||||
this.listBox1.TabIndex = 1;
|
|
||||||
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
|
|
||||||
//
|
|
||||||
// panel1
|
|
||||||
//
|
|
||||||
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
|
||||||
this.panel1.Controls.Add(this.listBox2);
|
|
||||||
this.panel1.Controls.Add(this.label4);
|
|
||||||
this.panel1.Controls.Add(this.label3);
|
|
||||||
this.panel1.Controls.Add(this.label2);
|
|
||||||
this.panel1.Controls.Add(this.label1);
|
|
||||||
this.panel1.Location = new System.Drawing.Point(12, 297);
|
|
||||||
this.panel1.Name = "panel1";
|
|
||||||
this.panel1.Size = new System.Drawing.Size(696, 244);
|
|
||||||
this.panel1.TabIndex = 2;
|
|
||||||
//
|
|
||||||
// listBox2
|
|
||||||
//
|
|
||||||
this.listBox2.FormattingEnabled = true;
|
|
||||||
this.listBox2.Location = new System.Drawing.Point(8, 71);
|
|
||||||
this.listBox2.Name = "listBox2";
|
|
||||||
this.listBox2.Size = new System.Drawing.Size(683, 160);
|
|
||||||
this.listBox2.TabIndex = 4;
|
|
||||||
//
|
|
||||||
// label4
|
|
||||||
//
|
|
||||||
this.label4.AutoSize = true;
|
|
||||||
this.label4.Location = new System.Drawing.Point(5, 55);
|
|
||||||
this.label4.Name = "label4";
|
|
||||||
this.label4.Size = new System.Drawing.Size(69, 13);
|
|
||||||
this.label4.TabIndex = 3;
|
|
||||||
this.label4.Text = "Referenced: ";
|
|
||||||
//
|
|
||||||
// label3
|
|
||||||
//
|
|
||||||
this.label3.AutoSize = true;
|
|
||||||
this.label3.Location = new System.Drawing.Point(5, 42);
|
|
||||||
this.label3.Name = "label3";
|
|
||||||
this.label3.Size = new System.Drawing.Size(40, 13);
|
|
||||||
this.label3.TabIndex = 2;
|
|
||||||
this.label3.Text = "Value: ";
|
|
||||||
//
|
|
||||||
// label2
|
|
||||||
//
|
|
||||||
this.label2.AutoSize = true;
|
|
||||||
this.label2.Location = new System.Drawing.Point(5, 29);
|
|
||||||
this.label2.Name = "label2";
|
|
||||||
this.label2.Size = new System.Drawing.Size(61, 13);
|
|
||||||
this.label2.TabIndex = 1;
|
|
||||||
this.label2.Text = "Defined in: ";
|
|
||||||
//
|
|
||||||
// label1
|
|
||||||
//
|
|
||||||
this.label1.AutoSize = true;
|
|
||||||
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
|
|
||||||
this.label1.Location = new System.Drawing.Point(3, 0);
|
|
||||||
this.label1.Name = "label1";
|
|
||||||
this.label1.Size = new System.Drawing.Size(79, 29);
|
|
||||||
this.label1.TabIndex = 0;
|
|
||||||
this.label1.Text = "label1";
|
|
||||||
//
|
|
||||||
// label5
|
|
||||||
//
|
|
||||||
this.label5.AutoSize = true;
|
|
||||||
this.label5.Location = new System.Drawing.Point(9, 38);
|
|
||||||
this.label5.Name = "label5";
|
|
||||||
this.label5.Size = new System.Drawing.Size(81, 13);
|
|
||||||
this.label5.TabIndex = 3;
|
|
||||||
this.label5.Text = "Files searched: ";
|
|
||||||
//
|
|
||||||
// Form1
|
|
||||||
//
|
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
|
||||||
this.ClientSize = new System.Drawing.Size(720, 553);
|
|
||||||
this.Controls.Add(this.label5);
|
|
||||||
this.Controls.Add(this.panel1);
|
|
||||||
this.Controls.Add(this.listBox1);
|
|
||||||
this.Controls.Add(this.button1);
|
|
||||||
this.Name = "Form1";
|
|
||||||
this.Text = "Unstandardness Test For DM";
|
|
||||||
this.panel1.ResumeLayout(false);
|
|
||||||
this.panel1.PerformLayout();
|
|
||||||
this.ResumeLayout(false);
|
|
||||||
this.PerformLayout();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
private System.Windows.Forms.Button button1;
|
|
||||||
private System.Windows.Forms.Panel panel1;
|
|
||||||
private System.Windows.Forms.Label label4;
|
|
||||||
private System.Windows.Forms.Label label3;
|
|
||||||
private System.Windows.Forms.Label label2;
|
|
||||||
private System.Windows.Forms.Label label1;
|
|
||||||
public System.Windows.Forms.ListBox listBox2;
|
|
||||||
public System.Windows.Forms.Label label5;
|
|
||||||
public System.Windows.Forms.ListBox listBox1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,484 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Data;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
using System.Collections;
|
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
namespace UnstandardnessTestForDM
|
|
||||||
{
|
|
||||||
public partial class Form1 : Form
|
|
||||||
{
|
|
||||||
DMSource source;
|
|
||||||
|
|
||||||
public Form1()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
source = new DMSource();
|
|
||||||
source.mainform = this;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void button1_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
source.find_all_defines();
|
|
||||||
generate_define_report();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void generate_define_report()
|
|
||||||
{
|
|
||||||
|
|
||||||
TextWriter tw = new StreamWriter("DEFINES REPORT.txt");
|
|
||||||
|
|
||||||
tw.WriteLine("Unstandardness Test For DM report for DEFINES");
|
|
||||||
tw.WriteLine("Generated on " + DateTime.Now);
|
|
||||||
tw.WriteLine("Total number of defines " + source.defines.Count());
|
|
||||||
tw.WriteLine("Total number of Files " + source.filessearched);
|
|
||||||
tw.WriteLine("Total number of references " + source.totalreferences);
|
|
||||||
tw.WriteLine("Total number of errorous defines " + source.errordefines);
|
|
||||||
tw.WriteLine("------------------------------------------------");
|
|
||||||
|
|
||||||
foreach (Define d in source.defines)
|
|
||||||
{
|
|
||||||
tw.WriteLine(d.name);
|
|
||||||
tw.WriteLine("\tValue: " + d.value);
|
|
||||||
tw.WriteLine("\tComment: " + d.comment);
|
|
||||||
tw.WriteLine("\tDefined in: " + d.location + " : " + d.line);
|
|
||||||
tw.WriteLine("\tNumber of references: " + d.references.Count());
|
|
||||||
foreach (String s in d.references)
|
|
||||||
{
|
|
||||||
tw.WriteLine("\t\t" + s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tw.WriteLine("------------------------------------------------");
|
|
||||||
tw.WriteLine("SUCCESS");
|
|
||||||
|
|
||||||
tw.Close();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Define d = (Define)listBox1.Items[listBox1.SelectedIndex];
|
|
||||||
label1.Text = d.name;
|
|
||||||
label2.Text = "Defined in: " + d.location + " : " + d.line;
|
|
||||||
label3.Text = "Value: " + d.value;
|
|
||||||
label4.Text = "References: " + d.references.Count();
|
|
||||||
listBox2.Items.Clear();
|
|
||||||
foreach (String s in d.references)
|
|
||||||
{
|
|
||||||
listBox2.Items.Add(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception ex) { Console.WriteLine("ERROR HERE: " + ex.Message); }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class DMSource
|
|
||||||
{
|
|
||||||
public List<Define> defines;
|
|
||||||
public const int FLAG_DEFINE = 1;
|
|
||||||
public Form1 mainform;
|
|
||||||
|
|
||||||
public int filessearched = 0;
|
|
||||||
public int totalreferences = 0;
|
|
||||||
public int errordefines = 0;
|
|
||||||
|
|
||||||
public List<String> filenames;
|
|
||||||
|
|
||||||
public DMSource()
|
|
||||||
{
|
|
||||||
defines = new List<Define>();
|
|
||||||
filenames = new List<String>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void find_all_defines()
|
|
||||||
{
|
|
||||||
find_all_files();
|
|
||||||
foreach(String filename in filenames){
|
|
||||||
searchFileForDefines(filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void find_all_files()
|
|
||||||
{
|
|
||||||
filenames = new List<String>();
|
|
||||||
String dmefilename = "";
|
|
||||||
|
|
||||||
foreach (string f in Directory.GetFiles("."))
|
|
||||||
{
|
|
||||||
if (f.ToLower().EndsWith(".dme"))
|
|
||||||
{
|
|
||||||
dmefilename = f;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dmefilename.Equals(""))
|
|
||||||
{
|
|
||||||
MessageBox.Show("dme file not found");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
using (var reader = File.OpenText(dmefilename))
|
|
||||||
{
|
|
||||||
String s;
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
s = reader.ReadLine();
|
|
||||||
|
|
||||||
if (!(s is String))
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (s.StartsWith("#include"))
|
|
||||||
{
|
|
||||||
int start = s.IndexOf("\"")+1;
|
|
||||||
s = s.Substring(start, s.Length - 11);
|
|
||||||
|
|
||||||
if (s.EndsWith(".dm"))
|
|
||||||
{
|
|
||||||
filenames.Add(s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
s = s.Trim(' ');
|
|
||||||
if (s == "") { continue; }
|
|
||||||
}
|
|
||||||
reader.Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void DirSearch(string sDir, int flag)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
foreach (string d in Directory.GetDirectories(sDir))
|
|
||||||
{
|
|
||||||
foreach (string f in Directory.GetFiles(d))
|
|
||||||
{
|
|
||||||
if (f.ToLower().EndsWith(".dm"))
|
|
||||||
{
|
|
||||||
if ((flag & FLAG_DEFINE) > 0)
|
|
||||||
{
|
|
||||||
searchFileForDefines(f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DirSearch(d, flag);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (System.Exception excpt)
|
|
||||||
{
|
|
||||||
Console.WriteLine("ERROR IN DIRSEARCH");
|
|
||||||
Console.WriteLine(excpt.Message);
|
|
||||||
Console.WriteLine(excpt.Data);
|
|
||||||
Console.WriteLine(excpt.ToString());
|
|
||||||
Console.WriteLine(excpt.StackTrace);
|
|
||||||
Console.WriteLine("END OF ERROR IN DIRSEARCH");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//DEFINES
|
|
||||||
public void searchFileForDefines(String fileName)
|
|
||||||
{
|
|
||||||
filessearched++;
|
|
||||||
FileInfo f = new FileInfo(fileName);
|
|
||||||
List<String> lines = new List<String>();
|
|
||||||
List<String> lines_without_comments = new List<String>();
|
|
||||||
|
|
||||||
mainform.label5.Text = "Files searched: " + filessearched + "; Defines found: " + defines.Count() + "; References found: " + totalreferences + "; Errorous defines: " + errordefines;
|
|
||||||
mainform.label5.Refresh();
|
|
||||||
|
|
||||||
//This code segment reads the file and stores it into the lines variable.
|
|
||||||
using (var reader = File.OpenText(fileName))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
String s;
|
|
||||||
while (true)
|
|
||||||
{
|
|
||||||
s = reader.ReadLine();
|
|
||||||
lines.Add(s);
|
|
||||||
s = s.Trim(' ');
|
|
||||||
if (s == "") { continue; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
reader.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
mainform.listBox1.Items.Add("ATTEMPTING: " + fileName);
|
|
||||||
lines_without_comments = remove_comments(lines);
|
|
||||||
|
|
||||||
/*TextWriter tw = new StreamWriter(fileName);
|
|
||||||
foreach (String s in lines_without_comments)
|
|
||||||
{
|
|
||||||
tw.WriteLine(s);
|
|
||||||
}
|
|
||||||
tw.Close();
|
|
||||||
mainform.listBox1.Items.Add("REWRITE: "+fileName);*/
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
for (int i = 0; i < lines_without_comments.Count; i++)
|
|
||||||
{
|
|
||||||
String line = lines_without_comments[i];
|
|
||||||
|
|
||||||
if (!(line is string))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
//Console.WriteLine("LINE: " + line);
|
|
||||||
|
|
||||||
foreach (Define define in defines)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (line.IndexOf(define.name) >= 0)
|
|
||||||
{
|
|
||||||
define.references.Add(fileName + " : " + i);
|
|
||||||
totalreferences++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if( line.ToLower().IndexOf("#define") >= 0 )
|
|
||||||
{
|
|
||||||
line = line.Trim();
|
|
||||||
line = line.Replace('\t', ' ');
|
|
||||||
//Console.WriteLine("LINE = "+line);
|
|
||||||
String[] slist = line.Split(' ');
|
|
||||||
if(slist.Length >= 3){
|
|
||||||
//slist[0] has the value of "#define"
|
|
||||||
String name = slist[1];
|
|
||||||
String value = slist[2];
|
|
||||||
|
|
||||||
for (int j = 3; j < slist.Length; j++)
|
|
||||||
{
|
|
||||||
value += " " + slist[j];
|
|
||||||
//Console.WriteLine("LISTITEM["+j+"] = "+slist[j]);
|
|
||||||
}
|
|
||||||
|
|
||||||
value = value.Trim();
|
|
||||||
|
|
||||||
String comment = "";
|
|
||||||
|
|
||||||
if (value.IndexOf("//") >= 0)
|
|
||||||
{
|
|
||||||
comment = value.Substring(value.IndexOf("//"));
|
|
||||||
value = value.Substring(0, value.IndexOf("//"));
|
|
||||||
}
|
|
||||||
|
|
||||||
comment = comment.Trim();
|
|
||||||
value = value.Trim();
|
|
||||||
|
|
||||||
Define d = new Define(fileName,i,name,value,comment);
|
|
||||||
defines.Add(d);
|
|
||||||
mainform.listBox1.Items.Add(d);
|
|
||||||
mainform.listBox1.Refresh();
|
|
||||||
}else{
|
|
||||||
Define d = new Define(fileName, i, "ERROR ERROR", "Something went wrong here", line);
|
|
||||||
errordefines++;
|
|
||||||
defines.Add(d);
|
|
||||||
mainform.listBox1.Items.Add(d);
|
|
||||||
mainform.listBox1.Refresh();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
Console.WriteLine(e.Message);
|
|
||||||
Console.WriteLine(e.StackTrace);
|
|
||||||
MessageBox.Show("Exception: " + e.Message + " | " + e.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool iscomment = false;
|
|
||||||
int ismultilinecomment = 0;
|
|
||||||
bool isstring = false;
|
|
||||||
bool ismultilinestring = false;
|
|
||||||
int escapesequence = 0;
|
|
||||||
int stringvar = 0;
|
|
||||||
|
|
||||||
public List<String> remove_comments(List<String> lines)
|
|
||||||
{
|
|
||||||
List<String> r = new List<String>();
|
|
||||||
|
|
||||||
iscomment = false;
|
|
||||||
ismultilinecomment = 0;
|
|
||||||
isstring = false;
|
|
||||||
ismultilinestring = false;
|
|
||||||
|
|
||||||
bool skiponechar = false; //Used so the / in */ doesn't get written;
|
|
||||||
|
|
||||||
for (int i = 0; i < lines.Count(); i++)
|
|
||||||
{
|
|
||||||
|
|
||||||
String line = lines[i];
|
|
||||||
|
|
||||||
if (!(line is String))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
iscomment = false;
|
|
||||||
isstring = false;
|
|
||||||
char ca = ' ';
|
|
||||||
escapesequence = 0;
|
|
||||||
|
|
||||||
String newline = "";
|
|
||||||
|
|
||||||
int k = line.Length;
|
|
||||||
|
|
||||||
for (int j = 0; j < k; j++)
|
|
||||||
{
|
|
||||||
|
|
||||||
char c = line.ToCharArray()[j];
|
|
||||||
|
|
||||||
if (escapesequence == 0)
|
|
||||||
if (normalstatus())
|
|
||||||
{
|
|
||||||
if (ca == '/' && c == '/')
|
|
||||||
{
|
|
||||||
c = ' ';
|
|
||||||
iscomment = true;
|
|
||||||
|
|
||||||
newline = newline.Remove(newline.Length - 1);
|
|
||||||
k = line.Length;
|
|
||||||
}
|
|
||||||
if (ca == '/' && c == '*')
|
|
||||||
{
|
|
||||||
c = ' ';
|
|
||||||
ismultilinecomment = 1;
|
|
||||||
newline = newline.Remove(newline.Length - 1);
|
|
||||||
k = line.Length;
|
|
||||||
}
|
|
||||||
if (c == '"')
|
|
||||||
{
|
|
||||||
isstring = true;
|
|
||||||
}
|
|
||||||
if (ca == '{' && c == '"')
|
|
||||||
{
|
|
||||||
ismultilinestring = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (isstring)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (c == '\\')
|
|
||||||
{
|
|
||||||
escapesequence = 2;
|
|
||||||
}
|
|
||||||
else if (stringvar > 0)
|
|
||||||
{
|
|
||||||
if (c == ']')
|
|
||||||
{
|
|
||||||
stringvar--;
|
|
||||||
}
|
|
||||||
else if (c == '[')
|
|
||||||
{
|
|
||||||
stringvar++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (c == '"')
|
|
||||||
{
|
|
||||||
isstring = false;
|
|
||||||
}
|
|
||||||
else if (c == '[')
|
|
||||||
{
|
|
||||||
stringvar++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (ismultilinestring)
|
|
||||||
{
|
|
||||||
if (ca == '"' && c == '}')
|
|
||||||
{
|
|
||||||
ismultilinestring = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (ismultilinecomment > 0)
|
|
||||||
{
|
|
||||||
if (ca == '/' && c == '*')
|
|
||||||
{
|
|
||||||
c = ' '; //These things are here to prevent /*/ from bieng interpreted as the start and end of a comment.
|
|
||||||
skiponechar = true;
|
|
||||||
ismultilinecomment++;
|
|
||||||
}
|
|
||||||
if (ca == '*' && c == '/')
|
|
||||||
{
|
|
||||||
c = ' '; //These things are here to prevent /*/ from bieng interpreted as the start and end of a comment.
|
|
||||||
skiponechar = true;
|
|
||||||
ismultilinecomment--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!iscomment && (ismultilinecomment==0) && !skiponechar)
|
|
||||||
{
|
|
||||||
newline += c;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (skiponechar)
|
|
||||||
{
|
|
||||||
skiponechar = false;
|
|
||||||
}
|
|
||||||
if (escapesequence > 0)
|
|
||||||
{
|
|
||||||
escapesequence--;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ca = c;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
r.Add(newline.TrimEnd());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return r;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool normalstatus()
|
|
||||||
{
|
|
||||||
return !isstring && !ismultilinestring && (ismultilinecomment==0) && !iscomment && (escapesequence == 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public class Define
|
|
||||||
{
|
|
||||||
public String location;
|
|
||||||
public int line;
|
|
||||||
public String name;
|
|
||||||
public String value;
|
|
||||||
public String comment;
|
|
||||||
public List<String> references;
|
|
||||||
|
|
||||||
public Define(String location, int line, String name, String value, String comment)
|
|
||||||
{
|
|
||||||
this.location = location;
|
|
||||||
this.line = line;
|
|
||||||
this.name = name;
|
|
||||||
this.value = value;
|
|
||||||
this.comment = comment;
|
|
||||||
this.references = new List<String>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override String ToString()
|
|
||||||
{
|
|
||||||
return "DEFINE: \""+name+"\" is defined as \""+value+"\" AT "+location+" : "+line;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<root>
|
|
||||||
<!--
|
|
||||||
Microsoft ResX Schema
|
|
||||||
|
|
||||||
Version 2.0
|
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
|
||||||
that is mostly human readable. The generation and parsing of the
|
|
||||||
various data types are done through the TypeConverter classes
|
|
||||||
associated with the data types.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
|
||||||
<resheader name="version">2.0</resheader>
|
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
|
||||||
</data>
|
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
|
||||||
<comment>This is a comment</comment>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
|
||||||
name/value pairs.
|
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
|
||||||
text/value conversion through the TypeConverter architecture.
|
|
||||||
Classes that don't support this are serialized and stored with the
|
|
||||||
mimetype set.
|
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
|
||||||
read any of the formats listed below.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
|
||||||
value : The object must be serialized into a byte array
|
|
||||||
: using a System.ComponentModel.TypeConverter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
-->
|
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:choice maxOccurs="unbounded">
|
|
||||||
<xsd:element name="metadata">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="assembly">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="data">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="resheader">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:schema>
|
|
||||||
<resheader name="resmimetype">
|
|
||||||
<value>text/microsoft-resx</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="version">
|
|
||||||
<value>2.0</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="reader">
|
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="writer">
|
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
</root>
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Windows.Forms;
|
|
||||||
|
|
||||||
namespace UnstandardnessTestForDM
|
|
||||||
{
|
|
||||||
static class Program
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The main entry point for the application.
|
|
||||||
/// </summary>
|
|
||||||
[STAThread]
|
|
||||||
static void Main()
|
|
||||||
{
|
|
||||||
Application.EnableVisualStyles();
|
|
||||||
Application.SetCompatibleTextRenderingDefault(false);
|
|
||||||
Application.Run(new Form1());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
using System.Reflection;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
|
||||||
// set of attributes. Change these attribute values to modify the information
|
|
||||||
// associated with an assembly.
|
|
||||||
[assembly: AssemblyTitle("UnstandardnessTestForDM")]
|
|
||||||
[assembly: AssemblyDescription("")]
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("Microsoft")]
|
|
||||||
[assembly: AssemblyProduct("UnstandardnessTestForDM")]
|
|
||||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2012")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyCulture("")]
|
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
|
||||||
// to COM components. If you need to access a type in this assembly from
|
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|
||||||
[assembly: Guid("c0e09000-1840-4416-8bb2-d86a8227adf1")]
|
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
|
||||||
//
|
|
||||||
// Major Version
|
|
||||||
// Minor Version
|
|
||||||
// Build Number
|
|
||||||
// Revision
|
|
||||||
//
|
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
|
||||||
// by using the '*' as shown below:
|
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by a tool.
|
|
||||||
// Runtime Version:4.0.30319.239
|
|
||||||
//
|
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||||
// the code is regenerated.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
namespace UnstandardnessTestForDM.Properties
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
|
||||||
/// </summary>
|
|
||||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
|
||||||
// class via a tool like ResGen or Visual Studio.
|
|
||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
|
||||||
// with the /str option, or rebuild your VS project.
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
internal class Resources
|
|
||||||
{
|
|
||||||
|
|
||||||
private static global::System.Resources.ResourceManager resourceMan;
|
|
||||||
|
|
||||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
|
||||||
|
|
||||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
|
||||||
internal Resources()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the cached ResourceManager instance used by this class.
|
|
||||||
/// </summary>
|
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
|
||||||
internal static global::System.Resources.ResourceManager ResourceManager
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if ((resourceMan == null))
|
|
||||||
{
|
|
||||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UnstandardnessTestForDM.Properties.Resources", typeof(Resources).Assembly);
|
|
||||||
resourceMan = temp;
|
|
||||||
}
|
|
||||||
return resourceMan;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Overrides the current thread's CurrentUICulture property for all
|
|
||||||
/// resource lookups using this strongly typed resource class.
|
|
||||||
/// </summary>
|
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
|
||||||
internal static global::System.Globalization.CultureInfo Culture
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return resourceCulture;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
resourceCulture = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,117 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<root>
|
|
||||||
<!--
|
|
||||||
Microsoft ResX Schema
|
|
||||||
|
|
||||||
Version 2.0
|
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
|
||||||
that is mostly human readable. The generation and parsing of the
|
|
||||||
various data types are done through the TypeConverter classes
|
|
||||||
associated with the data types.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
|
||||||
<resheader name="version">2.0</resheader>
|
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
|
||||||
</data>
|
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
|
||||||
<comment>This is a comment</comment>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
|
||||||
name/value pairs.
|
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
|
||||||
text/value conversion through the TypeConverter architecture.
|
|
||||||
Classes that don't support this are serialized and stored with the
|
|
||||||
mimetype set.
|
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
|
||||||
read any of the formats listed below.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
|
||||||
value : The object must be serialized into a byte array
|
|
||||||
: using a System.ComponentModel.TypeConverter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
-->
|
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:choice maxOccurs="unbounded">
|
|
||||||
<xsd:element name="metadata">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="assembly">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="data">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="resheader">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:schema>
|
|
||||||
<resheader name="resmimetype">
|
|
||||||
<value>text/microsoft-resx</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="version">
|
|
||||||
<value>2.0</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="reader">
|
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="writer">
|
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
</root>
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by a tool.
|
|
||||||
// Runtime Version:4.0.30319.239
|
|
||||||
//
|
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||||
// the code is regenerated.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
namespace UnstandardnessTestForDM.Properties
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
|
|
||||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
|
||||||
{
|
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
|
||||||
|
|
||||||
public static Settings Default
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return defaultInstance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
|
||||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
|
||||||
<Profiles>
|
|
||||||
<Profile Name="(Default)" />
|
|
||||||
</Profiles>
|
|
||||||
<Settings />
|
|
||||||
</SettingsFile>
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
|
||||||
<ProductVersion>8.0.30703</ProductVersion>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
<ProjectGuid>{A0EEBFC9-41D4-474D-853D-126AFDFB82DE}</ProjectGuid>
|
|
||||||
<OutputType>WinExe</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>UnstandardnessTestForDM</RootNamespace>
|
|
||||||
<AssemblyName>UnstandardnessTestForDM</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
|
||||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
|
||||||
<PlatformTarget>x86</PlatformTarget>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Deployment" />
|
|
||||||
<Reference Include="System.Drawing" />
|
|
||||||
<Reference Include="System.Windows.Forms" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="Form1.cs">
|
|
||||||
<SubType>Form</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Form1.Designer.cs">
|
|
||||||
<DependentUpon>Form1.cs</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Program.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<EmbeddedResource Include="Form1.resx">
|
|
||||||
<DependentUpon>Form1.cs</DependentUpon>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<EmbeddedResource Include="Properties\Resources.resx">
|
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<Compile Include="Properties\Resources.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DependentUpon>Resources.resx</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<None Include="Properties\Settings.settings">
|
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
|
||||||
</None>
|
|
||||||
<Compile Include="Properties\Settings.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DependentUpon>Settings.settings</DependentUpon>
|
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
||||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
|
||||||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
|
|
||||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
|
||||||
<security>
|
|
||||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
|
||||||
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
|
|
||||||
</requestedPrivileges>
|
|
||||||
</security>
|
|
||||||
</trustInfo>
|
|
||||||
</assembly>
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,18 +0,0 @@
|
|||||||
c:\users\baloh\documents\visual studio 2010\Projects\UnstandardnessTestForDM\UnstandardnessTestForDM\bin\Debug\UnstandardnessTestForDM.exe
|
|
||||||
c:\users\baloh\documents\visual studio 2010\Projects\UnstandardnessTestForDM\UnstandardnessTestForDM\bin\Debug\UnstandardnessTestForDM.pdb
|
|
||||||
c:\users\baloh\documents\visual studio 2010\Projects\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\ResolveAssemblyReference.cache
|
|
||||||
c:\users\baloh\documents\visual studio 2010\Projects\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\UnstandardnessTestForDM.Form1.resources
|
|
||||||
c:\users\baloh\documents\visual studio 2010\Projects\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\UnstandardnessTestForDM.Properties.Resources.resources
|
|
||||||
c:\users\baloh\documents\visual studio 2010\Projects\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\GenerateResource.read.1.tlog
|
|
||||||
c:\users\baloh\documents\visual studio 2010\Projects\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\GenerateResource.write.1.tlog
|
|
||||||
c:\users\baloh\documents\visual studio 2010\Projects\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\UnstandardnessTestForDM.exe
|
|
||||||
c:\users\baloh\documents\visual studio 2010\Projects\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\UnstandardnessTestForDM.pdb
|
|
||||||
C:\Users\Baloh\Desktop\tgs13\tools\UnstandardnessTestForDM\UnstandardnessTestForDM\bin\Debug\UnstandardnessTestForDM.exe
|
|
||||||
C:\Users\Baloh\Desktop\tgs13\tools\UnstandardnessTestForDM\UnstandardnessTestForDM\bin\Debug\UnstandardnessTestForDM.pdb
|
|
||||||
C:\Users\Baloh\Desktop\tgs13\tools\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\ResolveAssemblyReference.cache
|
|
||||||
C:\Users\Baloh\Desktop\tgs13\tools\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\UnstandardnessTestForDM.Form1.resources
|
|
||||||
C:\Users\Baloh\Desktop\tgs13\tools\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\UnstandardnessTestForDM.Properties.Resources.resources
|
|
||||||
C:\Users\Baloh\Desktop\tgs13\tools\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\GenerateResource.read.1.tlog
|
|
||||||
C:\Users\Baloh\Desktop\tgs13\tools\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\GenerateResource.write.1.tlog
|
|
||||||
C:\Users\Baloh\Desktop\tgs13\tools\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\UnstandardnessTestForDM.exe
|
|
||||||
C:\Users\Baloh\Desktop\tgs13\tools\UnstandardnessTestForDM\UnstandardnessTestForDM\obj\x86\Debug\UnstandardnessTestForDM.pdb
|
|
||||||
Binary file not shown.
Binary file not shown.
@@ -1,25 +0,0 @@
|
|||||||
#!/bin/bash -ex
|
|
||||||
set -x
|
|
||||||
# ARGUMENT 1: Map
|
|
||||||
BYOND_MAJOR="509"
|
|
||||||
BYOND_MINOR="1307"
|
|
||||||
# Jenkins doesn't have permissions to do this.
|
|
||||||
# Jenkins is also on Debian so the packages are wrong.
|
|
||||||
#apt-get update
|
|
||||||
#apt-get --yes install build-essential unzip lib32stdc++6 gcc-multilib
|
|
||||||
|
|
||||||
# This ensures we have an up-to-date LOCAL install of BYOND, and doesn't download it every goddamn build.
|
|
||||||
BYOND_DIR=/tmp/byond-${BYOND_MAJOR}.${BYOND_MINOR}
|
|
||||||
if [ ! -d $BYOND_DIR ]; then
|
|
||||||
rm -rf /tmp/byond-* byond.zip
|
|
||||||
curl "http://www.byond.com/download/build/${BYOND_MAJOR}/${BYOND_MAJOR}.${BYOND_MINOR}_byond_linux.zip" -o byond.zip
|
|
||||||
unzip byond.zip
|
|
||||||
mv byond/ $BYOND_DIR
|
|
||||||
cd $BYOND_DIR
|
|
||||||
make here
|
|
||||||
cd ..
|
|
||||||
fi
|
|
||||||
# Environment setup
|
|
||||||
source $BYOND_DIR/bin/byondsetup
|
|
||||||
|
|
||||||
bash dm.sh -M$1 vgstation13.dme
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
the compiled exe file for the Unstandardness text for DM program is in:
|
|
||||||
UnstandardnessTestForDM\bin\Debug\UnstandardnessTestForDM.exe
|
|
||||||
of
|
|
||||||
UnstandardnessTestForDM\bin\Release\UnstandardnessTestForDM.exe
|
|
||||||
|
|
||||||
You have to move it to the root folder (where the dme file is) and run it from there for it to work.
|
|
||||||
Reference in New Issue
Block a user